Merge "Use unittest.mock instead of third party mock"
This commit is contained in:
commit
7becea190a
|
@ -23,10 +23,10 @@ inline callbacks.
|
|||
|
||||
import eventlet
|
||||
eventlet.monkey_patch(os=False)
|
||||
import inspect
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import inspect
|
||||
import mock
|
||||
from nova.tests import fixtures as nova_fixtures
|
||||
from nova.tests.unit import conf_fixture
|
||||
from nova.tests.unit import policy_fixture
|
||||
|
@ -130,7 +130,6 @@ class NoDBTestCase(base.BaseTestCase):
|
|||
def patch(self, path, *args, **kwargs):
|
||||
patcher = mock.patch(path, *args, **kwargs)
|
||||
result = patcher.start()
|
||||
self.addCleanup(patcher.stop)
|
||||
return result
|
||||
|
||||
def assertPublicAPISignatures(self, baseinst, inst):
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova.compute import power_state
|
||||
from nova.compute import task_states
|
||||
from nova.compute import vm_states
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
"""Unit tests for the Hyper-V Cluster Driver."""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from nova import safe_utils
|
||||
from nova.virt import driver as nova_base_driver
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova.compute import vm_states
|
||||
from nova import exception
|
||||
from nova import test as nova_test
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from unittest import mock
|
||||
|
||||
import eventlet.hubs as hubs
|
||||
import mock
|
||||
import monotonic
|
||||
from os_win import utilsfactory
|
||||
from oslo_utils import importutils
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import block_device
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# under the License.
|
||||
|
||||
import inspect
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import tooz.coordination
|
||||
import tooz.locking
|
||||
|
||||
|
|
|
@ -13,14 +13,12 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
Unit tests for the Hyper-V Driver.
|
||||
"""
|
||||
"""Unit tests for the Hyper-V Driver."""
|
||||
|
||||
import platform
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from nova import exception
|
||||
from nova.image import glance
|
||||
from nova import safe_utils
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import utils
|
||||
from os_win import constants
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from nova import context as nova_context
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import fixtures
|
||||
import mock
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.tests.unit.objects import test_flavor
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import exception
|
||||
from nova.objects import migrate_data as migrate_data_obj
|
||||
from os_win import exceptions as os_win_exc
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import block_device
|
||||
from nova import exception
|
||||
from nova.virt import driver
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
import os
|
||||
import time
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import exception
|
||||
from os_win import exceptions as os_win_exc
|
||||
from oslo_utils import fileutils
|
||||
|
|
|
@ -13,12 +13,13 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from nova import exception
|
||||
from six.moves import builtins
|
||||
|
||||
from compute_hyperv.nova import pdk
|
||||
from compute_hyperv.tests.unit import test_base
|
||||
from six.moves import builtins
|
||||
|
||||
|
||||
class PDKTestCase(test_base.HyperVBaseTestCase):
|
||||
|
|
|
@ -13,11 +13,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
Unit tests for the Hyper-V RDPConsoleOps.
|
||||
"""
|
||||
"""Unit tests for the Hyper-V RDPConsoleOps."""
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from compute_hyperv.nova import rdpconsoleops
|
||||
from compute_hyperv.tests.unit import test_base
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from nova import exception
|
||||
|
||||
from compute_hyperv.nova import constants
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from nova import exception
|
||||
from six.moves import builtins
|
||||
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from nova import exception
|
||||
import socket
|
||||
from unittest import mock
|
||||
|
||||
from nova import exception
|
||||
|
||||
from compute_hyperv.nova import serialproxy
|
||||
from compute_hyperv.tests.unit import test_base
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from nova.compute import task_states
|
||||
from nova import exception
|
||||
from os_win import exceptions as os_win_exc
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import exception
|
||||
from nova.network import model
|
||||
from os_win import constants as os_win_const
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
from eventlet import timeout as etimeout
|
||||
import mock
|
||||
from nova.compute import task_states
|
||||
from nova.compute import vm_states
|
||||
from nova import exception
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
import contextlib
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova.compute import task_states
|
||||
from nova import exception
|
||||
from nova import test
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
|
|
|
@ -27,7 +27,6 @@ keystoneauth1==3.4.0
|
|||
linecache2==1.0.0
|
||||
MarkupSafe==1.0
|
||||
mccabe==0.2.1
|
||||
mock==2.0.0
|
||||
monotonic==1.4
|
||||
mox3==0.25.0
|
||||
msgpack==0.5.6
|
||||
|
|
Loading…
Reference in New Issue