From 8a11c21b736c03657a82494e76e03a8fb1d16a05 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 7 Jun 2025 23:24:16 -0500 Subject: [PATCH] "Fix" the test case I can't meaningfully unit test these things like this. I'll explore creating a tarball of a known Gitea configuration and using Docker to test against that. For now, just... kinda keep the test building. --- src/api/release_attachment.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api/release_attachment.rs b/src/api/release_attachment.rs index 9af71bf..9005dc0 100644 --- a/src/api/release_attachment.rs +++ b/src/api/release_attachment.rs @@ -103,11 +103,12 @@ mod tests { .await; let api_err = api_result.expect_err("Received Ok(()) after uploading non-existent file. That's nonsense, the API Function is wrong."); match api_err { - crate::Error::Placeholder => panic!("Received dummy response from the API function. Finish implementing it, stupid"), - crate::Error::WrappedReqwestErr(error) => panic!("Received a reqwest::Error from the API function: {error}"), - crate::Error::MissingAuthToken => unreachable!("Missing auth token... in a unit test that already panics without the auth token..."), - crate::Error::NoSuchFile => (), // test passes - crate::Error::ApiErrorMessage(api_error) => panic!("Received an error message from the API: {api_error:?}"), + crate::Error::Placeholder=>panic!("Received dummy response from the API function. Finish implementing it, stupid"), + crate::Error::WrappedReqwestErr(error)=>panic!("Received a reqwest::Error from the API function: {error}"), + crate::Error::MissingAuthToken=>unreachable!("Missing auth token... in a unit test that already panics without the auth token..."), + crate::Error::NoSuchFile=>(), + crate::Error::ApiErrorMessage(api_error)=>panic!("Received an error message from the API: {api_error:?}"), + crate::Error::NoSuchRelease => todo!(), } }