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: I4d45ae17f6f84f945f5dd049a929216ce6b6b58e
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
This commit is contained in:
Takashi Natsume 2020-04-26 07:08:53 +00:00
parent a132a63d82
commit 7ef2c28bf3
15 changed files with 14 additions and 18 deletions

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
import novaclient import novaclient
from novaclient import api_versions from novaclient import api_versions

View File

@ -14,9 +14,9 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
from keystoneauth1 import session from keystoneauth1 import session
import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils
import novaclient.api_versions import novaclient.api_versions

View File

@ -14,8 +14,7 @@
import base64 import base64
import subprocess import subprocess
from unittest import mock
import mock
from novaclient import crypto from novaclient import crypto
from novaclient.tests.unit import utils from novaclient.tests.unit import utils

View File

@ -15,8 +15,8 @@
import imp import imp
import inspect import inspect
from unittest import mock
import mock
import pkg_resources import pkg_resources
from novaclient import client from novaclient import client

View File

@ -16,11 +16,11 @@ import distutils.version as dist_version
import io import io
import re import re
import sys import sys
from unittest import mock
import ddt import ddt
import fixtures import fixtures
from keystoneauth1 import fixture from keystoneauth1 import fixture
import mock
import prettytable import prettytable
import requests_mock import requests_mock
from testtools import matchers from testtools import matchers

View File

@ -13,10 +13,9 @@
import io import io
import sys import sys
from unittest import mock
from urllib import parse from urllib import parse
import mock
from novaclient import base from novaclient import base
from novaclient import exceptions from novaclient import exceptions
from novaclient.tests.unit import fakes from novaclient.tests.unit import fakes

View File

@ -12,9 +12,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 from oslo_serialization import jsonutils
import requests import requests
from requests_mock.contrib import fixture as requests_mock_fixture from requests_mock.contrib import fixture as requests_mock_fixture

View File

@ -17,9 +17,9 @@
import copy import copy
import datetime import datetime
import re import re
from unittest import mock
from urllib import parse from urllib import parse
import mock
from oslo_utils import strutils from oslo_utils import strutils
import novaclient import novaclient

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 novaclient import api_versions from novaclient import api_versions
from novaclient import base from novaclient import base

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 novaclient.tests.unit.fixture_data import client from novaclient.tests.unit.fixture_data import client
from novaclient.tests.unit.fixture_data import images as data from novaclient.tests.unit.fixture_data import images as data

View File

@ -16,8 +16,7 @@ import base64
import io import io
import os import os
import tempfile import tempfile
from unittest import mock
import mock
from novaclient import api_versions from novaclient import api_versions
from novaclient import exceptions from novaclient import exceptions

View File

@ -23,9 +23,9 @@ import collections
import datetime import datetime
import io import io
import os import os
from unittest import mock
import fixtures import fixtures
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
import testtools import testtools

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 novaclient import api_versions from novaclient import api_versions
from novaclient import exceptions as exc from novaclient import exceptions as exc

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 novaclient import api_versions from novaclient import api_versions
from novaclient.tests.unit import utils from novaclient.tests.unit import utils

View File

@ -7,7 +7,6 @@ bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT ddt>=1.0.1 # MIT
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
python-keystoneclient>=3.8.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0
python-cinderclient!=4.0.0,>=3.3.0 # Apache-2.0 python-cinderclient!=4.0.0,>=3.3.0 # Apache-2.0
python-glanceclient>=2.8.0 # Apache-2.0 python-glanceclient>=2.8.0 # Apache-2.0