From 5d64eb21b784bbc3f691842c15761ca1ecafc180 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 18 Apr 2020 11:57:55 -0500 Subject: [PATCH] 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: Iaa4b9af611c27deaadc0d77bd9e903e4c1bc77ac Signed-off-by: Sean McGinnis --- cyborgclient/tests/unit/common/test_httpclient.py | 2 +- cyborgclient/tests/unit/osc/test_plugin.py | 2 +- cyborgclient/tests/unit/osc/v2/fakes.py | 2 +- cyborgclient/tests/unit/test_shell.py | 2 +- cyborgclient/tests/unit/v1/shell_test_base.py | 2 +- cyborgclient/tests/unit/v1/test_accelerators_shell.py | 2 +- cyborgclient/tests/unit/v1/test_client.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cyborgclient/tests/unit/common/test_httpclient.py b/cyborgclient/tests/unit/common/test_httpclient.py index 0c7b73e..f08057c 100644 --- a/cyborgclient/tests/unit/common/test_httpclient.py +++ b/cyborgclient/tests/unit/common/test_httpclient.py @@ -13,8 +13,8 @@ # under the License. import json +from unittest import mock -import mock import six diff --git a/cyborgclient/tests/unit/osc/test_plugin.py b/cyborgclient/tests/unit/osc/test_plugin.py index 10d0af0..690a1fc 100644 --- a/cyborgclient/tests/unit/osc/test_plugin.py +++ b/cyborgclient/tests/unit/osc/test_plugin.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. -import mock from openstack import connection as sdk_connection import testtools +from unittest import mock from cyborgclient.osc import plugin diff --git a/cyborgclient/tests/unit/osc/v2/fakes.py b/cyborgclient/tests/unit/osc/v2/fakes.py index bbbb9df..4278593 100644 --- a/cyborgclient/tests/unit/osc/v2/fakes.py +++ b/cyborgclient/tests/unit/osc/v2/fakes.py @@ -12,8 +12,8 @@ # from cyborgclient.tests.unit.osc import fakes -import mock from osc_lib.tests import utils +from unittest import mock import uuid deployable_created_at = '2019-06-24T00:00:00.000000+00:00' diff --git a/cyborgclient/tests/unit/test_shell.py b/cyborgclient/tests/unit/test_shell.py index 00638c3..442af60 100644 --- a/cyborgclient/tests/unit/test_shell.py +++ b/cyborgclient/tests/unit/test_shell.py @@ -14,10 +14,10 @@ import re import sys +from unittest import mock import fixtures from keystoneauth1 import fixture -import mock import six from testtools import matchers diff --git a/cyborgclient/tests/unit/v1/shell_test_base.py b/cyborgclient/tests/unit/v1/shell_test_base.py index 753bb28..687ed99 100644 --- a/cyborgclient/tests/unit/v1/shell_test_base.py +++ b/cyborgclient/tests/unit/v1/shell_test_base.py @@ -12,8 +12,8 @@ # under the License. import re +from unittest import mock -import mock from testtools import matchers from cyborgclient.tests.unit import utils diff --git a/cyborgclient/tests/unit/v1/test_accelerators_shell.py b/cyborgclient/tests/unit/v1/test_accelerators_shell.py index 393e484..15d14f1 100644 --- a/cyborgclient/tests/unit/v1/test_accelerators_shell.py +++ b/cyborgclient/tests/unit/v1/test_accelerators_shell.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from cyborgclient.tests.unit.v1 import shell_test_base diff --git a/cyborgclient/tests/unit/v1/test_client.py b/cyborgclient/tests/unit/v1/test_client.py index b70e063..02751e2 100644 --- a/cyborgclient/tests/unit/v1/test_client.py +++ b/cyborgclient/tests/unit/v1/test_client.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock import testtools +from unittest import mock from cyborgclient.v1 import client