Remove the dependency on the "mock" package

This repo is python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.

This patch moves all references to "import mock" to
"from unittest import mock".

Fixed one related functional test failure.

Change-Id: I4f7568b1af254488cbc75aefac2a1708e70eaf31
This commit is contained in:
Brian Haley 2020-04-01 16:17:50 -04:00
parent 6e7f454ccd
commit 88ea5cf828
4 changed files with 5 additions and 5 deletions

View File

@ -14,8 +14,8 @@
# under the License.
import copy
from unittest import mock
import mock
from neutron.common import utils as n_utils
from neutron_lib.plugins import directory
from octavia_lib.api.drivers import data_models as octavia_data_model
@ -288,7 +288,7 @@ class TestOctaviaOvnProviderDriver(
# 'provisioning_status': 'ACTIVE'}]},
updated_statuses = []
for call in update_loadbalancer_status.mock_calls:
updated_statuses.append(call.args[0])
updated_statuses.append(call[1][0])
calls_found = []
for expected_status in expected_statuses:
for updated_status in updated_statuses:

View File

@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from oslotest import base

View File

@ -13,8 +13,8 @@
#
import copy
from unittest import mock
import mock
from oslo_utils import uuidutils
from ovn_octavia_provider.common import constants

View File

@ -13,8 +13,8 @@
#
import copy
import os
from unittest import mock
import mock
from neutron.tests import base
from neutronclient.common import exceptions as n_exc
from octavia_lib.api.drivers import data_models