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: I8d8bcc60640a06b3cacf18714c4a22802e6c9827
This commit is contained in:
parent
30d0296f01
commit
69549e5d76
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from webob import exc
|
||||
|
||||
from ironic.api.controllers import base as cbase
|
||||
|
@ -15,10 +15,10 @@ Tests for the API /allocations/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -17,9 +17,9 @@ Tests for the API /chassis/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -15,8 +15,8 @@ Tests for the API /conductors/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -15,9 +15,9 @@ Tests for the API /deploy_templates/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
from http import client as http_client
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from testtools import matchers
|
||||
|
||||
|
@ -14,8 +14,7 @@ Tests for the API /events methods.
|
||||
"""
|
||||
|
||||
from http import client as http_client
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from ironic.api.controllers import base as api_base
|
||||
from ironic.api.controllers.v1 import types
|
||||
|
@ -19,8 +19,8 @@ import inspect
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
import pecan.rest
|
||||
import pecan.testing
|
||||
|
@ -17,10 +17,10 @@ import datetime
|
||||
from http import client as http_client
|
||||
import json
|
||||
import os
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -12,7 +12,8 @@
|
||||
|
||||
"""Test class for ironic-api notification utilities."""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from ironic.api.controllers.v1 import notification_utils as notif_utils
|
||||
|
@ -16,9 +16,9 @@ Tests for the API /ports/ methods.
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
import types
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -15,9 +15,9 @@ Tests for the API /portgroups/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -16,9 +16,9 @@ Tests for the API /lookup/ methods.
|
||||
"""
|
||||
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from webob import exc as webob_exc
|
||||
|
||||
from ironic.api.controllers import v1 as v1_api
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
from http import client as http_client
|
||||
import platform
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from pecan import rest
|
||||
|
||||
from ironic.api.controllers.v1 import types
|
||||
|
@ -15,8 +15,8 @@
|
||||
# under the License.
|
||||
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import os_traits
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -16,8 +16,7 @@ Tests for the versions constants and methods.
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from ironic.api.controllers.v1 import versions
|
||||
from ironic.common import release_mappings
|
||||
|
@ -17,9 +17,9 @@ Tests for the API /volume connectors/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -17,9 +17,9 @@ Tests for the API /volume targets/ methods.
|
||||
|
||||
import datetime
|
||||
from http import client as http_client
|
||||
from unittest import mock
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -50,7 +50,6 @@ logutils==0.3.5
|
||||
Mako==1.1.2
|
||||
MarkupSafe==1.1.1
|
||||
mccabe==0.6.1
|
||||
mock==4.0.2
|
||||
monotonic==1.5
|
||||
mox3==1.0.0
|
||||
msgpack-python==0.5.6
|
||||
|
Loading…
x
Reference in New Issue
Block a user