summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2023-12-15 18:00:29 +0100
committerCyborus <cyborus@cyborus.xyz>2023-12-15 18:00:29 +0100
commite725903eb973b5eb125f0fb7ce0cfa4c48080a4a (patch)
treeab96b9a419dbf3895d6602b01d6b4fad3248f670 /tests
parentadd release download methods (diff)
downloadforgejo-api-e725903eb973b5eb125f0fb7ce0cfa4c48080a4a.tar.xz
forgejo-api-e725903eb973b5eb125f0fb7ce0cfa4c48080a4a.zip
add download test
Diffstat (limited to 'tests')
-rw-r--r--tests/ci_test.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ci_test.rs b/tests/ci_test.rs
index 39acbd4..5812074 100644
--- a/tests/ci_test.rs
+++ b/tests/ci_test.rs
@@ -220,6 +220,14 @@ async fn repo(api: &forgejo_api::Forgejo) -> eyre::Result<()> {
)
.await
.wrap_err("failed to create release attachment")?;
+ ensure!(
+ api.download_release_attachment("TestingAdmin", "test", release.id, attachment.id)
+ .await?
+ .as_deref()
+ == Some(b"This is a file!"),
+ "couldn't download attachment"
+ );
+
api.delete_release_attachment("TestingAdmin", "test", release.id, attachment.id)
.await
.wrap_err("failed to deleted attachment")?;