Test should-panic when uploading missing file
I'm not sure I want this code path to panic, actually... It should probably return some error result so the app can print an error diagonstic. Oh well. That's a future problem. The end result is functionally identical.
This commit is contained in:
@@ -73,9 +73,30 @@ mod tests {
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn attach_file_missing() {
|
#[should_panic]
|
||||||
todo!();
|
async fn attach_file_missing() {
|
||||||
|
let conf = TestConfig::new();
|
||||||
|
let release_candidates =
|
||||||
|
crate::api::release::list_releases(
|
||||||
|
&conf.client,
|
||||||
|
&conf.server,
|
||||||
|
&conf.repo
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("Failed to get releases. Pre-conditions unmet, aborting test!");
|
||||||
|
|
||||||
|
let release = match_release_by_tag(&conf.release_tag, release_candidates)
|
||||||
|
.expect("Failed to select matching release. Pre-conditions unmet, aborting test!");
|
||||||
|
|
||||||
|
let api_result = super::create_release_attachment(
|
||||||
|
&conf.client,
|
||||||
|
&conf.server,
|
||||||
|
&conf.repo,
|
||||||
|
release.id,
|
||||||
|
vec![String::from("./this-file-doesnt-exist")],
|
||||||
|
)
|
||||||
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TestConfig {
|
struct TestConfig {
|
||||||
|
|||||||
Reference in New Issue
Block a user