add tests for the task deletion and task cancelation

This commit is contained in:
Irevoire 2022-10-26 11:23:51 +02:00 committed by Clément Renault
parent a85d5b4981
commit 033794d209
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
2 changed files with 42 additions and 13 deletions

View file

@ -156,6 +156,10 @@ impl Server {
.await
}
pub async fn delete_task(&self, value: Value) -> (Value, StatusCode) {
self.service.delete(format!("/tasks?{}", yaup::to_string(&value).unwrap())).await
}
pub async fn wait_task(&self, update_id: u64) -> Value {
// try several times to get status, or panic to not wait forever
let url = format!("/tasks/{}", update_id);