@@ -758,7 +758,7 @@ def test_RebootVM(self, bottle_request, StopVM):
758
758
self .assertEqual (res , "Error rebooting VM: Invalid VM ID" )
759
759
760
760
def test_GeVersion (self ):
761
- res = RESTGeVersion ()
761
+ res = RESTGetVersion ()
762
762
self .assertEqual (res , version )
763
763
764
764
@patch ("IM.InfrastructureManager.InfrastructureManager.CreateDiskSnapshot" )
@@ -1081,12 +1081,13 @@ def test_GetStats(self, GetStats, bottle_request):
1081
1081
"""Test REST GetStats."""
1082
1082
bottle_request .return_value = MagicMock ()
1083
1083
bottle_request .headers = {"AUTHORIZATION" : "type = InfrastructureManager; username = user; password = pass" }
1084
- GetStats .return_value = [{"stats" }]
1085
- bottle_request .params = {'init_date' : '2010-01-01' }
1084
+ GetStats .return_value = [{"key" : 1 }]
1085
+ bottle_request .params = {'init_date' : '2010-01-01' , 'end_date' : '2022-01-01' }
1086
1086
res = RESTGetStats ()
1087
- self .assertEqual (res , [ {"stats" }] )
1087
+ self .assertEqual (json . loads ( res ), {"stats" : [{ "key" : 1 }]} )
1088
1088
self .assertEqual (GetStats .call_args_list [0 ][0 ][0 ], '2010-01-01' )
1089
- self .assertEqual (GetStats .call_args_list [0 ][0 ][1 ].auth_list , [{"type" : "InfrastructureManager" ,
1089
+ self .assertEqual (GetStats .call_args_list [0 ][0 ][1 ], '2022-01-01' )
1090
+ self .assertEqual (GetStats .call_args_list [0 ][0 ][2 ].auth_list , [{"type" : "InfrastructureManager" ,
1090
1091
"username" : "user" ,
1091
1092
"password" : "pass" }])
1092
1093
0 commit comments