def test_get_unit_names_called_with_application_name(self): self.patch_object(juju_utils, 'model') juju_utils._get_unit_names(['aunit', 'otherunit/0']) self.model.get_first_unit_name.assert_called()
def test_get_unit_names(self): self.patch('zaza.model.get_first_unit_name', new_callable=mock.Mock(), name='_get_first_unit_name') juju_utils._get_unit_names(['aunit/0', 'otherunit/0']) self.assertFalse(self._get_first_unit_name.called)