Use unittest.mock instead of third party mock

Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I12e1a2a4a22116cabd09a3b808f871d98e4bd1f2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 11:58:59 -05:00
parent 3cfa54fa56
commit 4669bcc628
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
51 changed files with 50 additions and 53 deletions

View File

@ -39,7 +39,6 @@ kombu==4.0.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
mock==2.0.0
monotonic==0.6
mox3==0.20.0
msgpack-python==0.4.0

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.common import exceptions
from neutronclient.neutron.v2_0.bgp import speaker as bgp_speaker

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.neutron.v2_0.fw import firewallpolicy
from neutronclient import shell

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.neutron.v2_0.lb import healthmonitor
from neutronclient.tests.unit import test_cli20

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.neutron.v2_0.lb import pool
from neutronclient.tests.unit import test_cli20

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.neutron.v2_0.lb.v2 import loadbalancer as lb
from neutronclient.tests.unit import test_cli20

View File

@ -11,9 +11,9 @@
# under the License.
import copy
from unittest import mock
import uuid
import mock
from neutronclient.tests.unit.osc.v2 import fakes

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from neutronclient.osc.v2.dynamic_routing import bgp_dragent
from neutronclient.tests.unit.osc.v2.dynamic_routing import fakes

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from neutronclient.osc.v2.dynamic_routing import bgp_peer
from neutronclient.tests.unit.osc.v2.dynamic_routing import fakes

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from neutronclient.osc.v2.dynamic_routing import bgp_speaker
from neutronclient.tests.unit.osc.v2.dynamic_routing import fakes

View File

@ -12,9 +12,9 @@
#
import argparse
from unittest import mock
from cliff import columns as cliff_columns
import mock
from osc_lib.tests import utils

View File

@ -16,8 +16,8 @@
import collections
import copy
from unittest import mock
import mock
from oslo_utils import uuidutils

View File

@ -16,8 +16,8 @@
import copy
import re
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib.tests import utils

View File

@ -16,8 +16,8 @@
import copy
import re
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib.tests import utils

View File

@ -16,8 +16,8 @@
import copy
import re
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib.tests import utils
import testtools

View File

@ -16,10 +16,9 @@
import collections
import copy
from unittest import mock
import uuid
import mock
class FakeLogging(object):

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib.tests import utils
import testtools

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.utils import columns as column_util
from neutronclient.osc import utils as nc_osc_utils

View File

@ -16,8 +16,8 @@
import copy
import operator
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib import utils as osc_utils
from osc_lib.utils import columns as column_util

View File

@ -16,8 +16,8 @@
import copy
import operator
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib import utils as osc_utils
from osc_lib.utils import columns as column_util

View File

@ -16,8 +16,8 @@
import copy
import operator
from unittest import mock
import mock
from osc_lib.tests.utils import ParserException
from osc_lib import utils as osc_utils
from osc_lib.utils import columns as column_util

View File

@ -15,8 +15,8 @@
import argparse
import copy
from unittest import mock
import mock
from osc_lib.tests import utils
from oslo_utils import uuidutils

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from neutronclient.osc.v2.sfc import sfc_flow_classifier
from neutronclient.tests.unit.osc.v2.sfc import fakes

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from osc_lib import exceptions

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from neutronclient.osc.v2.sfc import sfc_port_pair
from neutronclient.tests.unit.osc.v2.sfc import fakes

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from neutronclient.osc.v2.sfc import sfc_port_pair_group
from neutronclient.tests.unit.osc.v2.sfc import fakes

View File

@ -11,8 +11,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import mock
from osc_lib import exceptions
from osc_lib.tests import utils as tests_utils

View File

@ -14,7 +14,7 @@
# under the License.
#
import mock
from unittest import mock
from neutronclient.osc.v2.subnet_onboard import subnet_onboard
from neutronclient.tests.unit.osc.v2 import fakes as test_fakes

View File

@ -11,8 +11,8 @@
# under the License.
import copy
from unittest import mock
import mock
from oslo_utils import uuidutils

View File

@ -15,8 +15,8 @@
import argparse
import copy
from unittest import mock
import mock
from mock import call
from osc_lib.cli import format_columns
from osc_lib import exceptions

View File

@ -16,10 +16,9 @@
import collections
import copy
from unittest import mock
import uuid
import mock
class FakeVPNaaS(object):

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as tests_utils
from neutronclient.osc import utils as osc_utils

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as tests_utils
from neutronclient.osc import utils as osc_utils

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.cli import format_columns
from osc_lib.tests import utils as tests_utils

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as tests_utils
from neutronclient.osc import utils as osc_utils

View File

@ -15,9 +15,9 @@
#
import copy
from unittest import mock
import uuid
import mock
from neutronclient.osc import utils as osc_utils
from neutronclient.osc.v2.vpnaas import vpnservice

View File

@ -18,9 +18,9 @@ import contextlib
from io import StringIO
import itertools
import sys
from unittest import mock
import urllib.parse as urlparse
import mock
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
from oslotest import base

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.common import exceptions
from neutronclient.neutron.v2_0 import address_scope

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.neutron.v2_0 import agentscheduler
from neutronclient.neutron.v2_0 import network

View File

@ -15,8 +15,8 @@
import itertools
import sys
from unittest import mock
import mock
from oslo_serialization import jsonutils
from neutronclient.common import exceptions

View File

@ -16,8 +16,8 @@
import itertools
import sys
from unittest import mock
import mock
from neutronclient.neutron.v2_0 import port
from neutronclient import shell

View File

@ -15,9 +15,9 @@
# under the License.
import sys
from unittest import mock
import urllib.parse as urlparse
import mock
from oslo_utils import uuidutils
from neutronclient.common import exceptions

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.common import exceptions
from neutronclient.neutron import v2_0 as neutronV20

View File

@ -15,8 +15,8 @@
#
import sys
from unittest import mock
import mock
from neutronclient.common import exceptions
from neutronclient.neutron.v2_0 import subnetpool

View File

@ -11,8 +11,8 @@
# under the License.
import sys
from unittest import mock
import mock
from neutronclient.common import exceptions
from neutronclient.neutron.v2_0 import network

View File

@ -16,8 +16,8 @@
import inspect
import sys
from unittest import mock
import mock
from neutronclient.common import extension
from neutronclient.neutron.v2_0.contrib import _fox_sockets as fox_sockets

View File

@ -13,8 +13,8 @@
# under the License.
import sys
from unittest import mock
import mock
from oslo_utils import encodeutils
import testtools

View File

@ -14,7 +14,8 @@
# under the License.
#
import mock
from unittest import mock
from oslo_utils import uuidutils
import testtools

View File

@ -15,8 +15,8 @@
# under the License.
import sys
from unittest import mock
import mock
from neutronclient.common import exceptions
from neutronclient.neutron.v2_0 import quota as test_quota

View File

@ -19,10 +19,10 @@ import logging
import os
import re
import sys
from unittest import mock
import fixtures
from keystoneauth1 import session
import mock
import testtools
from testtools import matchers

View File

@ -7,7 +7,6 @@ bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
flake8-import-order==0.12 # LGPLv3
mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0
osprofiler>=2.3.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0