File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
src/pybind/mgr/dashboard/tests Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -228,12 +228,17 @@ def list_daemons_mock(hostname=None, **_kwargs):
228228 self .assertNotIn ('service_instances' , by_host ['host-1' ])
229229
230230 # facts=true and include_service_instances=true
231- def get_facts_mock (hostname : str ):
232- return [{
233- 'hostname' : hostname ,
234- 'cpu_count' : 1 if hostname == 'host-0' else 2 ,
235- 'memory_total_kb' : 1024
236- }]
231+ def get_facts_mock (hostname = None , ** _kwargs ):
232+ if hostname :
233+ return [{
234+ 'hostname' : hostname ,
235+ 'cpu_count' : 1 if hostname == 'host-0' else 2 ,
236+ 'memory_total_kb' : 1024
237+ }]
238+ return [
239+ {'hostname' : 'host-0' , 'cpu_count' : 1 , 'memory_total_kb' : 1024 },
240+ {'hostname' : 'host-1' , 'cpu_count' : 2 , 'memory_total_kb' : 1024 }
241+ ]
237242
238243 fake_client .hosts .get_facts .side_effect = get_facts_mock
239244 self ._get (
You can’t perform that action at this time.
0 commit comments