Test the condition not the implementation
This commit is contained in:
@@ -816,7 +816,7 @@ class TestOpenStackUtils(ut_utils.BaseTestCase):
|
||||
_machine = mock.MagicMock()
|
||||
|
||||
# No machine returned
|
||||
self._get_machines.side_effect = KeyError
|
||||
self._get_machines.return_value = []
|
||||
with self.assertRaises(exceptions.ApplicationNotFound):
|
||||
openstack_utils.get_current_os_release_pair()
|
||||
self._get_machines.side_effect = None
|
||||
|
||||
@@ -1451,7 +1451,7 @@ def get_current_os_release_pair(application='keystone'):
|
||||
"""
|
||||
try:
|
||||
machine = list(juju_utils.get_machines_for_application(application))[0]
|
||||
except KeyError:
|
||||
except IndexError:
|
||||
raise exceptions.ApplicationNotFound(application)
|
||||
|
||||
series = juju_utils.get_machine_series(machine)
|
||||
|
||||
Reference in New Issue
Block a user