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: I805f5a4a901e410492c543c1857943ffd744ea35
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 11:58:22 -05:00 committed by Riccardo Pittau
parent 232f4e81ee
commit 93e7bb8747
25 changed files with 28 additions and 25 deletions

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslotest import base as test_base
from ironicclient.common.apiclient import base

View File

@ -14,8 +14,8 @@
# under the License.
import copy
from unittest import mock
import mock
import testtools
from ironicclient.common import base

View File

@ -11,9 +11,9 @@
# under the License.
import os
from unittest import mock
import dogpile.cache
import mock
from ironicclient.common import filecache
from ironicclient.tests.unit import utils

View File

@ -15,9 +15,9 @@
from http import client as http_client
import time
from unittest import mock
from keystoneauth1 import exceptions as kexc
import mock
from oslo_serialization import jsonutils
from ironicclient.common import filecache

View File

@ -19,8 +19,8 @@ import os
import subprocess
import sys
import tempfile
from unittest import mock
import mock
from ironicclient.common import utils
from ironicclient import exc

View File

@ -11,8 +11,8 @@
# under the License.
import argparse
from unittest import mock
import mock
import testtools
from ironicclient.osc import plugin

View File

@ -15,8 +15,8 @@
#
import json
from unittest import mock
import mock
from osc_lib.tests import utils
from ironicclient.tests.unit.osc import fakes

View File

@ -12,8 +12,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as osctestutils
from ironicclient import exc

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as oscutils
from ironicclient import exc

View File

@ -11,7 +11,8 @@
# under the License.
#
import mock
from unittest import mock
from osc_lib.tests import utils as oscutils
from ironicclient.osc.v1 import baremetal_create

View File

@ -13,8 +13,8 @@
import copy
import json
from unittest import mock
import mock
from osc_lib.tests import utils as osctestutils
from ironicclient import exc

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as oscutils
from ironicclient.common import utils as commonutils

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as osctestutils
from osc_lib import utils as oscutils

View File

@ -15,8 +15,8 @@
#
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as osctestutils
from ironicclient.osc.v1 import baremetal_portgroup

View File

@ -13,8 +13,8 @@
# under the License.
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as osctestutils
from ironicclient import exc

View File

@ -13,8 +13,8 @@
# under the License.
import copy
from unittest import mock
import mock
from osc_lib.tests import utils as osctestutils
from ironicclient import exc

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from openstack import config
from ironicclient import client as iroclient

View File

@ -14,8 +14,8 @@
# under the License.
from http import client as http_client
from unittest import mock
import mock
from ironicclient.common.apiclient import exceptions
from ironicclient import exc

View File

@ -16,9 +16,9 @@
import copy
import io
import os
from unittest import mock
import fixtures
import mock
from oslo_utils import strutils
import requests
import testtools

View File

@ -11,8 +11,8 @@
# under the License.
import copy
from unittest import mock
import mock
import testtools
from ironicclient import exc

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 ironicclient.common import filecache
from ironicclient.common import http

View File

@ -11,9 +11,9 @@
# under the License.
import builtins
from unittest import mock
import jsonschema
import mock
from ironicclient import exc
from ironicclient.tests.unit import utils

View File

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

View File

@ -15,8 +15,8 @@
import copy
import tempfile
import time
from unittest import mock
import mock
import testtools
from testtools.matchers import HasLength

View File

@ -7,7 +7,6 @@ doc8>=0.6.0 # Apache-2.0
flake8-import-order>=0.17.1 # LGPLv3
fixtures>=3.0.0 # Apache-2.0/BSD
requests-mock>=1.2.0 # Apache-2.0
mock>=2.0.0 # BSD
Babel!=2.4.0,>=2.3.4 # BSD
oslotest>=3.2.0 # Apache-2.0
testtools>=2.2.0 # MIT