Import CONFIGS instead of calling register_configs() again.
This commit is contained in:
parent
0105a75094
commit
1d9e1ae2ed
@ -8,17 +8,16 @@ from charmhelpers.contrib.openstack.utils import (
|
|||||||
do_action_openstack_upgrade,
|
do_action_openstack_upgrade,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ceilometer_hooks import config_changed
|
from ceilometer_hooks import (
|
||||||
|
config_changed,
|
||||||
|
CONFIGS,
|
||||||
|
)
|
||||||
|
|
||||||
from ceilometer_utils import (
|
from ceilometer_utils import (
|
||||||
do_openstack_upgrade,
|
do_openstack_upgrade,
|
||||||
register_configs
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
CONFIGS = register_configs()
|
|
||||||
|
|
||||||
|
|
||||||
def openstack_upgrade():
|
def openstack_upgrade():
|
||||||
"""Perform action-managed OpenStack upgrade.
|
"""Perform action-managed OpenStack upgrade.
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ from test_utils import (
|
|||||||
TO_PATCH = [
|
TO_PATCH = [
|
||||||
'config_changed',
|
'config_changed',
|
||||||
'do_openstack_upgrade',
|
'do_openstack_upgrade',
|
||||||
'register_configs',
|
|
||||||
'uuid'
|
'uuid'
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -24,12 +23,13 @@ class TestCinderUpgradeActions(CharmTestCase):
|
|||||||
super(TestCinderUpgradeActions, self).setUp(openstack_upgrade,
|
super(TestCinderUpgradeActions, self).setUp(openstack_upgrade,
|
||||||
TO_PATCH)
|
TO_PATCH)
|
||||||
|
|
||||||
|
@patch('charmhelpers.contrib.openstack.utils.juju_log')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.config')
|
@patch('charmhelpers.contrib.openstack.utils.config')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.action_set')
|
@patch('charmhelpers.contrib.openstack.utils.action_set')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.git_install_requested')
|
@patch('charmhelpers.contrib.openstack.utils.git_install_requested')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.openstack_upgrade_available')
|
@patch('charmhelpers.contrib.openstack.utils.openstack_upgrade_available')
|
||||||
def test_openstack_upgrade_true(self, upgrade_avail, git_requested,
|
def test_openstack_upgrade_true(self, upgrade_avail, git_requested,
|
||||||
action_set, config):
|
action_set, config, log):
|
||||||
git_requested.return_value = False
|
git_requested.return_value = False
|
||||||
upgrade_avail.return_value = True
|
upgrade_avail.return_value = True
|
||||||
config.return_value = True
|
config.return_value = True
|
||||||
@ -39,12 +39,13 @@ class TestCinderUpgradeActions(CharmTestCase):
|
|||||||
self.assertTrue(self.do_openstack_upgrade.called)
|
self.assertTrue(self.do_openstack_upgrade.called)
|
||||||
self.assertTrue(self.config_changed.called)
|
self.assertTrue(self.config_changed.called)
|
||||||
|
|
||||||
|
@patch('charmhelpers.contrib.openstack.utils.juju_log')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.config')
|
@patch('charmhelpers.contrib.openstack.utils.config')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.action_set')
|
@patch('charmhelpers.contrib.openstack.utils.action_set')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.git_install_requested')
|
@patch('charmhelpers.contrib.openstack.utils.git_install_requested')
|
||||||
@patch('charmhelpers.contrib.openstack.utils.openstack_upgrade_available')
|
@patch('charmhelpers.contrib.openstack.utils.openstack_upgrade_available')
|
||||||
def test_openstack_upgrade_false(self, upgrade_avail, git_requested,
|
def test_openstack_upgrade_false(self, upgrade_avail, git_requested,
|
||||||
action_set, config):
|
action_set, config, log):
|
||||||
git_requested.return_value = False
|
git_requested.return_value = False
|
||||||
upgrade_avail.return_value = True
|
upgrade_avail.return_value = True
|
||||||
config.return_value = False
|
config.return_value = False
|
||||||
|
Loading…
Reference in New Issue
Block a user