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:
parent
a132a63d82
commit
7ef2c28bf3
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue