File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ def test_main(self) -> None:
55
55
)
56
56
57
57
with patch ("usage.date_range" ) as mock_date_range :
58
- mock_date_range .return_value = [33 , 44 ]
58
+ mock_date_range .return_value = [
59
+ "mock-date-1" ,
60
+ "mock-date-2" ,
61
+ ]
59
62
60
63
mock_timer = MagicMock ()
61
64
mock_timer .past_due = True
@@ -71,14 +74,14 @@ def test_main(self) -> None:
71
74
mock_get_all_usage .assert_has_calls (
72
75
[
73
76
call (
74
- 44 ,
75
- 44 ,
77
+ "mock-date-2" ,
78
+ "mock-date-2" ,
76
79
billing_account_id = None ,
77
80
mgmt_group = "mgmt-group" ,
78
81
),
79
82
call (
80
- 33 ,
81
- 33 ,
83
+ "mock-date-1" ,
84
+ "mock-date-1" ,
82
85
billing_account_id = None ,
83
86
mgmt_group = "mgmt-group" ,
84
87
),
@@ -89,8 +92,14 @@ def test_main(self) -> None:
89
92
call (
90
93
HTTP_ADAPTER .validate_python ("https://my.host" ),
91
94
["usage1" , "usage2" ],
92
- start_datetime .date (),
93
- end_datetime .date (),
95
+ "mock-date-2" ,
96
+ "mock-date-2" ,
97
+ ),
98
+ call (
99
+ HTTP_ADAPTER .validate_python ("https://my.host" ),
100
+ ["usage1" , "usage2" ],
101
+ "mock-date-1" ,
102
+ "mock-date-1" ,
94
103
),
95
104
]
96
105
)
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ def main(mytimer: func.TimerRequest) -> None:
61
61
retrieve_and_send_usage (
62
62
config .API_URL ,
63
63
usage ,
64
- start_datetime . date () ,
65
- end_datetime . date () ,
64
+ usage_date ,
65
+ usage_date ,
66
66
)
67
67
break
68
68
except HttpResponseError as e :
You can’t perform that action at this time.
0 commit comments