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: If1de2f48da1fd6ed3f96c98b8dce9eace4f8095d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 12:01:03 -05:00 committed by Martin Kopec
parent 0c71fc29a1
commit eed8074e64
38 changed files with 47 additions and 38 deletions

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 oslo_utils import uuidutils from oslo_utils import uuidutils
import six import six

View File

@ -12,7 +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 from unittest import mock
from oslotest import base from oslotest import base

View File

@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
import fixtures import fixtures
import mock
from oslo_config import cfg from oslo_config import cfg
from tempest.cmd import account_generator from tempest.cmd import account_generator

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import mock from unittest import mock
from tempest.cmd import cleanup from tempest.cmd import cleanup
from tempest.tests import base from tempest.tests import base

View File

@ -18,9 +18,9 @@ import os
import shutil import shutil
import subprocess import subprocess
import tempfile import tempfile
from unittest import mock
import fixtures import fixtures
import mock
import six import six
from tempest.cmd import run from tempest.cmd import run

View File

@ -13,9 +13,9 @@
# under the License. # under the License.
import os import os
from unittest import mock
import fixtures import fixtures
import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest import clients from tempest import clients

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
from six.moves.urllib import parse as urlparse from six.moves.urllib import parse as urlparse
import mock
from tempest.common import compute from tempest.common import compute
from tempest.tests import base from tempest.tests import base

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_config import cfg from oslo_config import cfg
import testtools import testtools

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import time import time
from unittest import mock
import mock
from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils.fixture import uuidsentinel as uuids
from tempest.common import waiters from tempest.common import waiters

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 tempest.common.utils import net_utils from tempest.common.utils import net_utils
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc

View File

@ -12,8 +12,8 @@
# under the License. # under the License.
import subprocess import subprocess
from unittest import mock
import mock
from tempest.lib.cli import base as cli_base from tempest.lib.cli import base as cli_base
from tempest.lib import exceptions from tempest.lib import exceptions

View File

@ -11,7 +11,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 tempest.lib.common import cred_client from tempest.lib.common import cred_client
from tempest.tests import base from tempest.tests import base

View File

@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
import fixtures import fixtures
import mock
from oslo_config import cfg from oslo_config import cfg
from tempest.common import credentials_factory as credentials from tempest.common import credentials_factory as credentials

View File

@ -15,8 +15,8 @@
import hashlib import hashlib
import os import os
import shutil import shutil
from unittest import mock
import mock
import six import six
import testtools import testtools

View File

@ -10,7 +10,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
import testtools import testtools
from tempest.lib.common import profiler from tempest.lib.common import profiler

View File

@ -11,8 +11,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from unittest import mock
import fixtures import fixtures
import mock
import testtools import testtools
from tempest.lib.common import validation_resources as vr from tempest.lib.common import validation_resources as vr

View File

@ -13,7 +13,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 tempest.lib.common import ssh from tempest.lib.common import ssh
from tempest.lib.common.utils.linux import remote_client from tempest.lib.common.utils.linux import remote_client

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import time import time
from unittest import mock
import mock
from tempest.lib.common import thread from tempest.lib.common import thread
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_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 tempest.lib.common import rest_client from tempest.lib.common import rest_client
from tempest.lib import exceptions from tempest.lib import exceptions

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from tempest.lib.services.compute import base_compute_client from tempest.lib.services.compute import base_compute_client
from tempest.lib.services.compute import servers_client from tempest.lib.services.compute import servers_client

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from tempest.lib.services.compute import base_compute_client from tempest.lib.services.compute import base_compute_client
from tempest.lib.services.compute import services_client from tempest.lib.services.compute import services_client

View File

@ -12,7 +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 from unittest import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client from tempest.lib.common import rest_client

View File

@ -12,7 +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 from unittest import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client from tempest.lib.common import rest_client

View File

@ -13,7 +13,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 tempest.lib.services.network import base as base_network_client from tempest.lib.services.network import base as base_network_client
from tempest.tests.lib import fake_auth_provider from tempest.tests.lib import fake_auth_provider

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest.lib.services.network import base as network_base from tempest.lib.services.network import base as network_base

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest.lib.services.network import base as network_base from tempest.lib.services.network import base as network_base

View File

@ -14,7 +14,7 @@
# under the License. # under the License.
import mock from unittest import mock
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest.lib.services.object_storage import object_client from tempest.lib.services.object_storage import object_client

View File

@ -13,9 +13,9 @@
# the License. # the License.
import types import types
from unittest import mock
import fixtures import fixtures
import mock
import six import six
import testtools import testtools

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest.lib.services.volume.v3 import services_client from tempest.lib.services.volume.v3 import services_client

View File

@ -13,7 +13,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 oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json
from tempest.lib.services.volume.v3 import transfers_client from tempest.lib.services.volume.v3 import transfers_client

View File

@ -13,7 +13,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 oslo_serialization import jsonutils as json from oslo_serialization import jsonutils as json

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import abc import abc
from unittest import mock
import mock
import six import six
import testtools import testtools

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import socket import socket
from unittest import mock
import mock
import six import six
from six import StringIO from six import StringIO
import testtools import testtools

View File

@ -12,7 +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 from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from tempest import clients from tempest import clients

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 tempest.tests import base from tempest.tests import base

View File

@ -15,8 +15,8 @@
import os import os
import sys import sys
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
import testtools import testtools

View File

@ -2,7 +2,6 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking>=3.0.1,<3.1.0;python_version>='3.5' # Apache-2.0 hacking>=3.0.1,<3.1.0;python_version>='3.5' # Apache-2.0
mock>=2.0.0 # BSD
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
pycodestyle>=2.0.0,<2.6.0 # MIT pycodestyle>=2.0.0,<2.6.0 # MIT