From: Abhishek Desai Date: Mon, 25 Aug 2025 14:11:45 +0000 (+0530) Subject: mgr/dashboard: Fix test_host.py test case X-Git-Tag: v20.1.1~79^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F65225%2Fhead;p=ceph.git mgr/dashboard: Fix test_host.py test case fixes: https://tracker.ceph.com/issues/72717 Signed-off-by: Abhishek Desai --- diff --git a/src/pybind/mgr/dashboard/tests/test_host.py b/src/pybind/mgr/dashboard/tests/test_host.py index ff7971cd3556..10a6c9508f6c 100644 --- a/src/pybind/mgr/dashboard/tests/test_host.py +++ b/src/pybind/mgr/dashboard/tests/test_host.py @@ -210,12 +210,17 @@ class HostControllerTest(ControllerTestCase): self.assertNotIn('service_instances', by_host['host-1']) # facts=true and include_service_instances=true - def get_facts_mock(hostname: str): - return [{ - 'hostname': hostname, - 'cpu_count': 1 if hostname == 'host-0' else 2, - 'memory_total_kb': 1024 - }] + def get_facts_mock(hostname=None, **_kwargs): + if hostname: + return [{ + 'hostname': hostname, + 'cpu_count': 1 if hostname == 'host-0' else 2, + 'memory_total_kb': 1024 + }] + return [ + {'hostname': 'host-0', 'cpu_count': 1, 'memory_total_kb': 1024}, + {'hostname': 'host-1', 'cpu_count': 2, 'memory_total_kb': 1024} + ] fake_client.hosts.get_facts.side_effect = get_facts_mock self._get(