Fix some tests.
This commit is contained in:
parent
28f275ea26
commit
6876c23774
@ -4,7 +4,9 @@ from collections import OrderedDict
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
os.environ['JUJU_UNIT_NAME'] = 'glance'
|
os.environ['JUJU_UNIT_NAME'] = 'glance'
|
||||||
import hooks.glance_utils as utils
|
|
||||||
|
with patch('charmhelpers.core.hookenv.config') as config:
|
||||||
|
import hooks.glance_utils as utils
|
||||||
|
|
||||||
from test_utils import (
|
from test_utils import (
|
||||||
CharmTestCase,
|
CharmTestCase,
|
||||||
@ -131,16 +133,16 @@ class TestGlanceUtils(CharmTestCase):
|
|||||||
])
|
])
|
||||||
self.assertEquals(ex_map, utils.restart_map())
|
self.assertEquals(ex_map, utils.restart_map())
|
||||||
|
|
||||||
@patch('charmhelpers.contrib.openstack.utils.config')
|
@patch.object(utils, 'git_install_requested')
|
||||||
def test_determine_packages(self, _config):
|
def test_determine_packages(self, git_install_requested):
|
||||||
_config.return_value = None
|
git_install_requested.return_value = False
|
||||||
result = utils.determine_packages()
|
result = utils.determine_packages()
|
||||||
ex = utils.PACKAGES
|
ex = utils.PACKAGES
|
||||||
self.assertEquals(set(ex), set(result))
|
self.assertEquals(set(ex), set(result))
|
||||||
|
|
||||||
@patch('charmhelpers.contrib.openstack.utils.config')
|
@patch.object(utils, 'git_install_requested')
|
||||||
def test_determine_packages_git(self, _config):
|
def test_determine_packages_git(self, git_install_requested):
|
||||||
_config.return_value = openstack_origin_git
|
git_install_requested.return_value = True
|
||||||
result = utils.determine_packages()
|
result = utils.determine_packages()
|
||||||
ex = utils.PACKAGES + utils.BASE_GIT_PACKAGES
|
ex = utils.PACKAGES + utils.BASE_GIT_PACKAGES
|
||||||
for p in utils.GIT_PACKAGE_BLACKLIST:
|
for p in utils.GIT_PACKAGE_BLACKLIST:
|
||||||
|
Loading…
Reference in New Issue
Block a user