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: I4a5b1ec999110a50fc904f3ae93e3983efa64f88
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 11:58:37 -05:00
parent e6288837d4
commit 3eafa2a001
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
23 changed files with 25 additions and 23 deletions

View File

@ -13,7 +13,8 @@
# under the License. # under the License.
# #
import mock from unittest import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import sys import sys

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.osc.v1 import certificates as osc_certificates from magnumclient.osc.v1 import certificates as osc_certificates
from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes

View File

@ -14,8 +14,8 @@
# #
import copy import copy
import mock
from mock import call from mock import call
from unittest import mock
from magnumclient.exceptions import InvalidAttribute from magnumclient.exceptions import InvalidAttribute
from magnumclient.osc.v1 import cluster_templates as osc_ct from magnumclient.osc.v1 import cluster_templates as osc_ct

View File

@ -14,10 +14,10 @@
# #
import copy import copy
import mock
import os import os
import sys import sys
import tempfile import tempfile
from unittest import mock
from contextlib import contextmanager from contextlib import contextmanager
try: try:

View File

@ -9,7 +9,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.osc.v1 import mservices from magnumclient.osc.v1 import mservices
from magnumclient.tests.osc.unit.v1 import fakes from magnumclient.tests.osc.unit.v1 import fakes

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import copy import copy
import mock
from mock import call from mock import call
from unittest import mock
from magnumclient.osc.v1 import nodegroups as osc_nodegroups from magnumclient.osc.v1 import nodegroups as osc_nodegroups
from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes

View File

@ -11,7 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.osc.v1 import quotas as osc_quotas from magnumclient.osc.v1 import quotas as osc_quotas
from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.osc.v1 import stats as osc_stats from magnumclient.osc.v1 import stats as osc_stats
from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes from magnumclient.tests.osc.unit.v1 import fakes as magnum_fakes

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock
import testtools import testtools
from unittest import mock
from magnumclient import client from magnumclient import client

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
import socket import socket

View File

@ -14,11 +14,11 @@
import re import re
import sys import sys
from unittest import mock
import argparse import argparse
import fixtures import fixtures
from keystoneauth1 import fixture from keystoneauth1 import fixture
import mock
import six import six
from testtools import matchers from testtools import matchers

View File

@ -16,7 +16,8 @@
# under the License. # under the License.
import collections import collections
import mock from unittest import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
import six.moves.builtins as __builtin__ import six.moves.builtins as __builtin__

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import re import re
from unittest import mock
import mock
from testtools import matchers from testtools import matchers
from magnumclient.tests import utils from magnumclient.tests import utils

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.common.apiclient import exceptions from magnumclient.common.apiclient import exceptions
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient import exceptions from magnumclient import exceptions
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.common import cliutils from magnumclient.common import cliutils
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock
import testtools import testtools
from unittest import mock
from keystoneauth1.exceptions import catalog from keystoneauth1.exceptions import catalog

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.common import cliutils from magnumclient.common import cliutils
from magnumclient import exceptions from magnumclient import exceptions

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.common.apiclient import exceptions from magnumclient.common.apiclient import exceptions
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from magnumclient.tests.v1 import shell_test_base from magnumclient.tests.v1 import shell_test_base
from magnumclient.v1.stats import Stats from magnumclient.v1.stats import Stats

View File

@ -11,4 +11,3 @@ osprofiler>=1.4.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
mock>=2.0.0 # BSD