@@ -154,6 +154,19 @@ def test_update_data(settings, patched_update):
154
154
_verify_update (settings , patched_update , data = {"a" : 1 })
155
155
156
156
157
+ def test_increment_value (settings , patched_update ):
158
+ api_task = task_for_test ()
159
+ task = Task (api_task )
160
+
161
+ patched_update .return_value = Response (HTTPStatus .OK , b"" , {}, task_for_test (value = 10 ))
162
+
163
+ task .increment_value (10 )
164
+ _verify_update (settings , patched_update , value = 10 )
165
+
166
+ task .increment_value (5 )
167
+ _verify_update (settings , patched_update , value = 15 )
168
+
169
+
157
170
def test_ping (settings , patched_update ):
158
171
task = Task (task_for_test ())
159
172
@@ -179,18 +192,18 @@ def test_update_progress_rate_limit(settings, patched_update):
179
192
180
193
updated_at = task .updated
181
194
patched_update .return_value = Response (HTTPStatus .OK , b"" , {}, task_for_test ())
182
- task .update_progress (2 , rate_limit = 1 )
195
+ task .update_value (2 , rate_limit = 1 )
183
196
assert len (patched_update .call_args_list ) == 0
184
197
185
- task .update_progress (2 )
198
+ task .update_value (2 )
186
199
_verify_update (settings , patched_update , value = 2 )
187
200
assert task .updated > updated_at
188
201
189
- task .update_progress (3 , rate_limit = 1 )
202
+ task .update_value (3 , rate_limit = 1 )
190
203
assert len (patched_update .call_args_list ) == 1
191
204
192
205
task ._task .updated = task ._task .updated - datetime .timedelta (seconds = 1 )
193
- task .update_progress (3 , rate_limit = 1 )
206
+ task .update_value (3 , rate_limit = 1 )
194
207
assert len (patched_update .call_args_list ) == 2
195
208
196
209
0 commit comments