Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2 runtimes. Since we now only support py36 and later, we can use the standard lib unittest.mock module instead. Change-Id: I70a406c060ba681ddc000788b3fa5ab2bba4d41f
This commit is contained in:
parent
052de8653b
commit
da9cb79e93
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
import webtest.app
|
import webtest.app
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,13 @@
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
from cryptography.hazmat.primitives.asymmetric import padding
|
from cryptography.hazmat.primitives.asymmetric import padding
|
||||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||||
from cryptography.hazmat.primitives import hashes
|
from cryptography.hazmat.primitives import hashes
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
import mock
|
|
||||||
import webtest.app
|
import webtest.app
|
||||||
|
|
||||||
from refstack.tests import api
|
from refstack.tests import api
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
import webtest.app
|
import webtest.app
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
import webtest.app
|
import webtest.app
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Refstack unittests."""
|
"""Refstack unittests."""
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
"""Tests for API's controllers"""
|
"""Tests for API's controllers"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
import webob.exc
|
import webob.exc
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
|
|
||||||
"""Tests for API's utils"""
|
"""Tests for API's utils"""
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
"""Tests for API's utility"""
|
"""Tests for API's utility"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
import pecan
|
import pecan
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import hashlib
|
import hashlib
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
import sqlalchemy.orm
|
import sqlalchemy.orm
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import httmock
|
import httmock
|
||||||
import mock
|
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
"""Tests for refstack's migrations."""
|
"""Tests for refstack's migrations."""
|
||||||
|
|
||||||
import alembic
|
import alembic
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
|
|
||||||
from refstack.db import migration
|
from refstack.db import migration
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
"""Tests for validators."""
|
"""Tests for validators."""
|
||||||
import binascii
|
import binascii
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
from cryptography.hazmat.primitives.asymmetric import padding
|
from cryptography.hazmat.primitives.asymmetric import padding
|
||||||
|
@ -24,7 +25,6 @@ from cryptography.hazmat.primitives import hashes
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import mock
|
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
|
|
||||||
from refstack.api import exceptions as api_exc
|
from refstack.api import exceptions as api_exc
|
||||||
|
|
|
@ -4,7 +4,6 @@ pyflakes==0.8.1
|
||||||
flake8==2.2.4
|
flake8==2.2.4
|
||||||
docutils>=0.11 # OSI-Approved Open Source, Public Domain
|
docutils>=0.11 # OSI-Approved Open Source, Public Domain
|
||||||
httmock>=1.2.4
|
httmock>=1.2.4
|
||||||
mock
|
|
||||||
oslotest>=1.2.0 # Apache-2.0
|
oslotest>=1.2.0 # Apache-2.0
|
||||||
python-subunit>=0.0.18
|
python-subunit>=0.0.18
|
||||||
stestr>=1.1.0 # Apache-2.0
|
stestr>=1.1.0 # Apache-2.0
|
||||||
|
|
Loading…
Reference in New Issue