Skip to content

Commit 11b7d63

Browse files
Zuulopenstack-gerrit
Zuul
authored andcommitted
Merge "Use unittest.mock instead of third party mock"
2 parents 1297cdf + 7ef2c28 commit 11b7d63

15 files changed

+14
-18
lines changed

novaclient/tests/unit/test_api_versions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16-
import mock
16+
from unittest import mock
1717

1818
import novaclient
1919
from novaclient import api_versions

novaclient/tests/unit/test_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# under the License.
1515

1616
import copy
17+
from unittest import mock
1718

1819
from keystoneauth1 import session
19-
import mock
2020
from oslo_utils import uuidutils
2121

2222
import novaclient.api_versions

novaclient/tests/unit/test_crypto.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
import base64
1616
import subprocess
17-
18-
import mock
17+
from unittest import mock
1918

2019
from novaclient import crypto
2120
from novaclient.tests.unit import utils

novaclient/tests/unit/test_discover.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
import imp
1717
import inspect
18+
from unittest import mock
1819

19-
import mock
2020
import pkg_resources
2121

2222
from novaclient import client

novaclient/tests/unit/test_shell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
import io
1717
import re
1818
import sys
19+
from unittest import mock
1920

2021
import ddt
2122
import fixtures
2223
from keystoneauth1 import fixture
23-
import mock
2424
import prettytable
2525
import requests_mock
2626
from testtools import matchers

novaclient/tests/unit/test_utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313

1414
import io
1515
import sys
16+
from unittest import mock
1617
from urllib import parse
1718

18-
import mock
19-
2019
from novaclient import base
2120
from novaclient import exceptions
2221
from novaclient.tests.unit import fakes

novaclient/tests/unit/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# under the License.
1313

1414
import os
15+
from unittest import mock
1516

1617
import fixtures
17-
import mock
1818
from oslo_serialization import jsonutils
1919
import requests
2020
from requests_mock.contrib import fixture as requests_mock_fixture

novaclient/tests/unit/v2/fakes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
import copy
1818
import datetime
1919
import re
20+
from unittest import mock
2021
from urllib import parse
2122

22-
import mock
2323
from oslo_utils import strutils
2424

2525
import novaclient

novaclient/tests/unit/v2/test_flavors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16-
import mock
16+
from unittest import mock
1717

1818
from novaclient import api_versions
1919
from novaclient import base

novaclient/tests/unit/v2/test_images.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# License for the specific language governing permissions and limitations
1212
# under the License.
1313

14-
import mock
14+
from unittest import mock
1515

1616
from novaclient.tests.unit.fixture_data import client
1717
from novaclient.tests.unit.fixture_data import images as data

novaclient/tests/unit/v2/test_servers.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
import io
1717
import os
1818
import tempfile
19-
20-
import mock
19+
from unittest import mock
2120

2221
from novaclient import api_versions
2322
from novaclient import exceptions

novaclient/tests/unit/v2/test_shell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import datetime
2424
import io
2525
import os
26+
from unittest import mock
2627

2728
import fixtures
28-
import mock
2929
from oslo_utils import timeutils
3030
import testtools
3131

novaclient/tests/unit/v2/test_versions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
import mock
15+
from unittest import mock
1616

1717
from novaclient import api_versions
1818
from novaclient import exceptions as exc

novaclient/tests/unit/v2/test_volumes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16-
import mock
16+
from unittest import mock
1717

1818
from novaclient import api_versions
1919
from novaclient.tests.unit import utils

test-requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ bandit>=1.1.0 # Apache-2.0
77
coverage!=4.4,>=4.0 # Apache-2.0
88
ddt>=1.0.1 # MIT
99
fixtures>=3.0.0 # Apache-2.0/BSD
10-
mock>=2.0.0 # BSD
1110
python-keystoneclient>=3.8.0 # Apache-2.0
1211
python-cinderclient!=4.0.0,>=3.3.0 # Apache-2.0
1312
python-glanceclient>=2.8.0 # Apache-2.0

0 commit comments

Comments
 (0)