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:
parent
3cfa54fa56
commit
4669bcc628
@ -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
|
||||
|
@ -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
|
||||
|
@ -15,8 +15,8 @@
|
||||
#
|
||||
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from neutronclient.neutron.v2_0.fw import firewallpolicy
|
||||
from neutronclient import shell
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import collections
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -16,10 +16,9 @@
|
||||
|
||||
import collections
|
||||
import copy
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
|
||||
|
||||
class FakeLogging(object):
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -16,10 +16,9 @@
|
||||
|
||||
import collections
|
||||
import copy
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
|
||||
|
||||
class FakeVPNaaS(object):
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
import itertools
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from neutronclient.common import exceptions
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -15,8 +15,8 @@
|
||||
#
|
||||
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from neutronclient.common import exceptions
|
||||
from neutronclient.neutron.v2_0 import subnetpool
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import encodeutils
|
||||
import testtools
|
||||
|
||||
|
@ -14,7 +14,8 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
import testtools
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user