better error for setting url of unknown demo

This commit is contained in:
Robin Appelman 2022-05-15 16:06:31 +02:00
commit 808c2ec0ed
2 changed files with 27 additions and 3 deletions

View file

@ -223,6 +223,24 @@ async fn test_set_url_invalid_hash() {
assert!(matches!(res.unwrap_err(), Error::HashMisMatch));
}
#[tokio::test]
async fn test_set_url_unknown_demo() {
let client = test_client().await;
let res = client
.set_url(
99,
"tests",
"tests",
"http://example.com/tests",
[0; 16],
"edit",
)
.await;
dbg!(&res);
assert!(matches!(res.unwrap_err(), Error::DemoNotFound(99)));
}
#[tokio::test]
async fn test_set_url() {
let client = test_client().await;