summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@gmail.com>2020-03-31 13:51:21 -0500
committerSean McGinnis <sean.mcginnis@gmail.com>2020-03-31 14:37:19 -0500
commitc9c34169deab26418e693eeb78b98319b922a168 (patch)
treef2ceca59ed225d08a282e3dd6371634606c0884d
parentd16593eb10518df1e366623260963d651c5625e6 (diff)
downloadoslo-vmware-c9c34169deab26418e693eeb78b98319b922a168.tar.gz
Use unittest.mock instead of third party mockussuri-em3.3.1
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: I4d8eada1df0ec43162d4729bf75147eb40252b72 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
-rw-r--r--lower-constraints.txt1
-rw-r--r--oslo_vmware/tests/objects/test_datacenter.py2
-rw-r--r--oslo_vmware/tests/objects/test_datastore.py3
-rw-r--r--oslo_vmware/tests/test_api.py9
-rw-r--r--oslo_vmware/tests/test_dvs_util.py7
-rw-r--r--oslo_vmware/tests/test_exceptions.py6
-rw-r--r--oslo_vmware/tests/test_image_transfer.py7
-rw-r--r--oslo_vmware/tests/test_pbm.py6
-rw-r--r--oslo_vmware/tests/test_rw_handles.py6
-rw-r--r--oslo_vmware/tests/test_service.py2
-rw-r--r--oslo_vmware/tests/test_vim.py6
-rw-r--r--oslo_vmware/tests/test_vim_util.py7
-rw-r--r--test-requirements.txt1
13 files changed, 22 insertions, 41 deletions
diff --git a/lower-constraints.txt b/lower-constraints.txt
index bfadfcb..2bd229a 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -22,7 +22,6 @@ linecache2==1.0.0
lxml==3.4.1
MarkupSafe==1.0
mccabe==0.2.1
-mock==2.0.0
netaddr==0.7.18
netifaces==0.10.4
openstackdocstheme==1.20.0
diff --git a/oslo_vmware/tests/objects/test_datacenter.py b/oslo_vmware/tests/objects/test_datacenter.py
index c4d261e..2a346f9 100644
--- a/oslo_vmware/tests/objects/test_datacenter.py
+++ b/oslo_vmware/tests/objects/test_datacenter.py
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import mock
+from unittest import mock
from oslo_vmware.objects import datacenter
from oslo_vmware.tests import base
diff --git a/oslo_vmware/tests/objects/test_datastore.py b/oslo_vmware/tests/objects/test_datastore.py
index bda052b..68cc0ea 100644
--- a/oslo_vmware/tests/objects/test_datastore.py
+++ b/oslo_vmware/tests/objects/test_datastore.py
@@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-import mock
+from unittest import mock
+
from oslo_utils import units
import urllib.parse as urlparse
diff --git a/oslo_vmware/tests/test_api.py b/oslo_vmware/tests/test_api.py
index 298aabd..499436d 100644
--- a/oslo_vmware/tests/test_api.py
+++ b/oslo_vmware/tests/test_api.py
@@ -14,16 +14,15 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for session management and API invocation classes.
-"""
+"""Unit tests for session management and API invocation classes."""
from datetime import datetime
+from unittest import mock
+
from eventlet import greenthread
-import mock
+from oslo_context import context
import suds
-from oslo_context import context
from oslo_vmware import api
from oslo_vmware import exceptions
from oslo_vmware import pbm
diff --git a/oslo_vmware/tests/test_dvs_util.py b/oslo_vmware/tests/test_dvs_util.py
index 1179d46..8382a40 100644
--- a/oslo_vmware/tests/test_dvs_util.py
+++ b/oslo_vmware/tests/test_dvs_util.py
@@ -13,13 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for VMware DVS utility module.
-"""
+"""Unit tests for VMware DVS utility module."""
import collections
-
-import mock
+from unittest import mock
from oslo_vmware import dvs_util
from oslo_vmware.tests import base
diff --git a/oslo_vmware/tests/test_exceptions.py b/oslo_vmware/tests/test_exceptions.py
index d70756b..6c393ad 100644
--- a/oslo_vmware/tests/test_exceptions.py
+++ b/oslo_vmware/tests/test_exceptions.py
@@ -13,10 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for exceptions module.
-"""
-import mock
+"""Unit tests for exceptions module."""
+from unittest import mock
from oslo_vmware._i18n import _
from oslo_vmware import exceptions
diff --git a/oslo_vmware/tests/test_image_transfer.py b/oslo_vmware/tests/test_image_transfer.py
index f1ad58b..b21bedb 100644
--- a/oslo_vmware/tests/test_image_transfer.py
+++ b/oslo_vmware/tests/test_image_transfer.py
@@ -13,13 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for functions and classes for image transfer.
-"""
+"""Unit tests for functions and classes for image transfer."""
import io
-
-import mock
+from unittest import mock
from oslo_vmware import exceptions
from oslo_vmware import image_transfer
diff --git a/oslo_vmware/tests/test_pbm.py b/oslo_vmware/tests/test_pbm.py
index 3b57506..2a3b29f 100644
--- a/oslo_vmware/tests/test_pbm.py
+++ b/oslo_vmware/tests/test_pbm.py
@@ -13,13 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for PBM utility methods.
-"""
+"""Unit tests for PBM utility methods."""
import os
+from unittest import mock
-import mock
import urllib.parse as urlparse
import urllib.request as urllib
diff --git a/oslo_vmware/tests/test_rw_handles.py b/oslo_vmware/tests/test_rw_handles.py
index b35faed..1301bb7 100644
--- a/oslo_vmware/tests/test_rw_handles.py
+++ b/oslo_vmware/tests/test_rw_handles.py
@@ -13,13 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for read and write handles for image transfer.
-"""
+"""Unit tests for read and write handles for image transfer."""
import ssl
+from unittest import mock
-import mock
import requests
from oslo_vmware import exceptions
diff --git a/oslo_vmware/tests/test_service.py b/oslo_vmware/tests/test_service.py
index 2065454..c3cc23f 100644
--- a/oslo_vmware/tests/test_service.py
+++ b/oslo_vmware/tests/test_service.py
@@ -15,9 +15,9 @@
import http.client as httplib
import io
+from unittest import mock
import ddt
-import mock
import requests
import suds
diff --git a/oslo_vmware/tests/test_vim.py b/oslo_vmware/tests/test_vim.py
index ddfa82e..0887a05 100644
--- a/oslo_vmware/tests/test_vim.py
+++ b/oslo_vmware/tests/test_vim.py
@@ -13,13 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for classes to invoke VMware VI SOAP calls.
-"""
+"""Unit tests for classes to invoke VMware VI SOAP calls."""
import copy
+from unittest import mock
-import mock
from oslo_i18n import fixture as i18n_fixture
import suds
diff --git a/oslo_vmware/tests/test_vim_util.py b/oslo_vmware/tests/test_vim_util.py
index 36d6375..e73bf6e 100644
--- a/oslo_vmware/tests/test_vim_util.py
+++ b/oslo_vmware/tests/test_vim_util.py
@@ -13,13 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Unit tests for VMware API utility module.
-"""
+"""Unit tests for VMware API utility module."""
import collections
-
-import mock
+from unittest import mock
from oslo_vmware.tests import base
from oslo_vmware import vim_util
diff --git a/test-requirements.txt b/test-requirements.txt
index 3c8beeb..65fa4f8 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -6,7 +6,6 @@
hacking>=3.0,<3.1.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
-mock>=2.0.0 # BSD
testtools>=2.2.0 # MIT
stestr>=2.0.0 # Apache-2.0