From fd40e903ba11c4990c7ad66c20dad7b84423d4ec Mon Sep 17 00:00:00 2001 From: Rodrigo Barbieri Date: Tue, 3 Oct 2023 12:33:13 -0300 Subject: [PATCH] added unit test --- .../test_zaza_utilities_openstack.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/unit_tests/utilities/test_zaza_utilities_openstack.py b/unit_tests/utilities/test_zaza_utilities_openstack.py index 358f15a64..f2fa068a0 100644 --- a/unit_tests/utilities/test_zaza_utilities_openstack.py +++ b/unit_tests/utilities/test_zaza_utilities_openstack.py @@ -543,6 +543,27 @@ def test_upload_image_to_glance(self): expected_status='active', msg='Image status wait') + def test_get_app_names_for_charm(self): + self.patch_object(openstack_utils.juju_utils, "get_full_juju_status", + return_value={ + "applications": { + "nova-compute-kvm": { + "charm-name": 'nova-compute', + }, + "nova-compute-sriov": { + "charm-name": 'nova-compute' + }, + "cinder": { + "charm-name": 'cinder-volume', + }, + }, + }) + self.assertEqual( + ['nova-compute-kvm', 'nova-compute-sriov'], + openstack_utils.get_app_names_for_charm('nova-compute')) + self.get_full_juju_status.assert_called_once_with(model_name=None) + + def test_is_ceph_image_backend_True(self): self.patch_object(openstack_utils.juju_utils, "get_full_juju_status", return_value={