Browse Source

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>
changes/21/721021/5
Sean McGinnis 1 year ago
committed by Martin Kopec
parent
commit
eed8074e64
38 changed files with 47 additions and 38 deletions
  1. +1
    -1
      tempest/tests/api/compute/test_base.py
  2. +2
    -1
      tempest/tests/base.py
  3. +2
    -1
      tempest/tests/cmd/test_account_generator.py
  4. +1
    -1
      tempest/tests/cmd/test_cleanup.py
  5. +1
    -1
      tempest/tests/cmd/test_run.py
  6. +1
    -1
      tempest/tests/cmd/test_verify_tempest_config.py
  7. +2
    -1
      tempest/tests/common/test_compute.py
  8. +2
    -1
      tempest/tests/common/test_credentials_factory.py
  9. +1
    -1
      tempest/tests/common/test_waiters.py
  10. +1
    -1
      tempest/tests/common/utils/test_net_utils.py
  11. +1
    -1
      tempest/tests/lib/cli/test_execute.py
  12. +1
    -1
      tempest/tests/lib/common/test_cred_client.py
  13. +2
    -1
      tempest/tests/lib/common/test_dynamic_creds.py
  14. +1
    -1
      tempest/tests/lib/common/test_preprov_creds.py
  15. +2
    -1
      tempest/tests/lib/common/test_profiler.py
  16. +2
    -1
      tempest/tests/lib/common/test_validation_resources.py
  17. +1
    -1
      tempest/tests/lib/common/utils/linux/test_remote_client.py
  18. +1
    -1
      tempest/tests/lib/common/utils/test_test_utils.py
  19. +1
    -1
      tempest/tests/lib/services/compute/test_base_compute_client.py
  20. +1
    -1
      tempest/tests/lib/services/compute/test_servers_client.py
  21. +1
    -1
      tempest/tests/lib/services/compute/test_services_client.py
  22. +2
    -1
      tempest/tests/lib/services/identity/v2/test_token_client.py
  23. +2
    -1
      tempest/tests/lib/services/identity/v3/test_token_client.py
  24. +1
    -1
      tempest/tests/lib/services/network/test_base_network_client.py
  25. +1
    -1
      tempest/tests/lib/services/network/test_security_group_rules_client.py
  26. +1
    -1
      tempest/tests/lib/services/network/test_security_groups_client.py
  27. +1
    -1
      tempest/tests/lib/services/object_storage/test_object_client.py
  28. +1
    -1
      tempest/tests/lib/services/test_clients.py
  29. +1
    -1
      tempest/tests/lib/services/volume/v3/test_services_client.py
  30. +1
    -1
      tempest/tests/lib/services/volume/v3/test_snapshot_manage_client.py
  31. +1
    -1
      tempest/tests/lib/services/volume/v3/test_transfers_client.py
  32. +1
    -1
      tempest/tests/lib/services/volume/v3/test_volume_manage_client.py
  33. +1
    -1
      tempest/tests/lib/test_decorators.py
  34. +1
    -1
      tempest/tests/lib/test_ssh.py
  35. +2
    -1
      tempest/tests/test_base_test.py
  36. +1
    -1
      tempest/tests/test_imports.py
  37. +1
    -1
      tempest/tests/test_test.py
  38. +0
    -1
      test-requirements.txt

+ 1
- 1
tempest/tests/api/compute/test_base.py View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_utils import uuidutils
import six


+ 2
- 1
tempest/tests/base.py View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslotest import base


+ 2
- 1
tempest/tests/cmd/test_account_generator.py View File

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


+ 1
- 1
tempest/tests/cmd/test_cleanup.py View File

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


+ 1
- 1
tempest/tests/cmd/test_run.py View File

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


+ 1
- 1
tempest/tests/cmd/test_verify_tempest_config.py View File

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


+ 2
- 1
tempest/tests/common/test_compute.py View File

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


+ 2
- 1
tempest/tests/common/test_credentials_factory.py 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 oslo_config import cfg
import testtools


+ 1
- 1
tempest/tests/common/test_waiters.py View File

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


+ 1
- 1
tempest/tests/common/utils/test_net_utils.py 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 tempest.common.utils import net_utils
from tempest.lib import exceptions as lib_exc


+ 1
- 1
tempest/tests/lib/cli/test_execute.py View File

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


+ 1
- 1
tempest/tests/lib/common/test_cred_client.py View File

@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from tempest.lib.common import cred_client
from tempest.tests import base


+ 2
- 1
tempest/tests/lib/common/test_dynamic_creds.py View File

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


+ 1
- 1
tempest/tests/lib/common/test_preprov_creds.py View File

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


+ 2
- 1
tempest/tests/lib/common/test_profiler.py View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import testtools
from tempest.lib.common import profiler


+ 2
- 1
tempest/tests/lib/common/test_validation_resources.py View File

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


+ 1
- 1
tempest/tests/lib/common/utils/linux/test_remote_client.py 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 tempest.lib.common import ssh
from tempest.lib.common.utils.linux import remote_client


+ 1
- 1
tempest/tests/lib/common/utils/test_test_utils.py View File

@ -14,8 +14,8 @@
# under the License.
import time
from unittest import mock
import mock
from tempest.lib.common import thread
from tempest.lib.common.utils import test_utils


+ 1
- 1
tempest/tests/lib/services/compute/test_base_compute_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/compute/test_servers_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/compute/test_services_client.py View File

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


+ 2
- 1
tempest/tests/lib/services/identity/v2/test_token_client.py View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client


+ 2
- 1
tempest/tests/lib/services/identity/v3/test_token_client.py View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client


+ 1
- 1
tempest/tests/lib/services/network/test_base_network_client.py 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 tempest.lib.services.network import base as base_network_client
from tempest.tests.lib import fake_auth_provider


+ 1
- 1
tempest/tests/lib/services/network/test_security_group_rules_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/network/test_security_groups_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/object_storage/test_object_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/test_clients.py View File

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


+ 1
- 1
tempest/tests/lib/services/volume/v3/test_services_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/volume/v3/test_snapshot_manage_client.py 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 oslo_serialization import jsonutils as json


+ 1
- 1
tempest/tests/lib/services/volume/v3/test_transfers_client.py View File

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


+ 1
- 1
tempest/tests/lib/services/volume/v3/test_volume_manage_client.py 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 oslo_serialization import jsonutils as json


+ 1
- 1
tempest/tests/lib/test_decorators.py View File

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


+ 1
- 1
tempest/tests/lib/test_ssh.py View File

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


+ 2
- 1
tempest/tests/test_base_test.py View File

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


+ 1
- 1
tempest/tests/test_imports.py View File

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


+ 1
- 1
tempest/tests/test_test.py View File

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


+ 0
- 1
test-requirements.txt View File

@ -2,7 +2,6 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
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
oslotest>=3.2.0 # Apache-2.0
pycodestyle>=2.0.0,<2.6.0 # MIT


Loading…
Cancel
Save