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 Tamo
parent 1cf081f9a3
commit d1720d8431
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);