Rejig unit_tests to drop hook prefixes
This commit is contained in:
parent
570df36fff
commit
4d68c2ce7c
@ -1,9 +1,9 @@
|
||||
from mock import patch
|
||||
from unit_tests.test_utils import CharmTestCase
|
||||
from test_utils import CharmTestCase
|
||||
|
||||
from charmhelpers.contrib.openstack.context import OSContextError
|
||||
|
||||
import hooks.nova_compute_context as context
|
||||
import nova_compute_context as context
|
||||
|
||||
TO_PATCH = [
|
||||
'apt_install',
|
||||
|
@ -1,8 +1,8 @@
|
||||
from mock import call, patch, MagicMock
|
||||
|
||||
from unit_tests.test_utils import CharmTestCase
|
||||
from test_utils import CharmTestCase
|
||||
|
||||
import hooks.nova_compute_utils as utils
|
||||
import nova_compute_utils as utils
|
||||
|
||||
_reg = utils.register_configs
|
||||
_map = utils.restart_map
|
||||
@ -10,7 +10,7 @@ _map = utils.restart_map
|
||||
utils.register_configs = MagicMock()
|
||||
utils.restart_map = MagicMock()
|
||||
|
||||
import hooks.nova_compute_hooks as hooks
|
||||
import nova_compute_hooks as hooks
|
||||
|
||||
utils.register_configs = _reg
|
||||
utils.restart_map = _map
|
||||
|
@ -1,9 +1,9 @@
|
||||
from mock import patch, MagicMock, call
|
||||
|
||||
from unit_tests.test_utils import CharmTestCase, patch_open
|
||||
from test_utils import CharmTestCase, patch_open
|
||||
|
||||
|
||||
import hooks.nova_compute_utils as utils
|
||||
import nova_compute_utils as utils
|
||||
|
||||
TO_PATCH = [
|
||||
'config',
|
||||
@ -212,7 +212,7 @@ class NovaComputeUtilsTests(CharmTestCase):
|
||||
_file.write.assert_called_with('foo_cert\n')
|
||||
check_call.assert_called_with(['update-ca-certificates'])
|
||||
|
||||
@patch('hooks.charmhelpers.contrib.openstack.templating.OSConfigRenderer')
|
||||
@patch('charmhelpers.contrib.openstack.templating.OSConfigRenderer')
|
||||
@patch.object(utils, 'quantum_enabled')
|
||||
@patch.object(utils, 'resource_map')
|
||||
def test_register_configs(self, resource_map, quantum, renderer):
|
||||
|
Loading…
x
Reference in New Issue
Block a user