test(integration-test): testing snapshot fetching

This commit is contained in:
Scott Lyons 2024-08-11 13:38:05 -07:00
commit 6d840de69f
3 changed files with 16 additions and 72 deletions

View file

@ -1,4 +1,5 @@
use chrono::Months;
use sha1::{Digest, Sha1};
use std::error::Error;
use std::fs::File;
use std::path::Path;
@ -56,6 +57,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
test_pools(&auth_client).await;
test_comments(&auth_client).await;
test_users(&auth_client).await;
test_snapshots(&auth_client).await;
Command::new("sh")
.current_dir(env!("CARGO_MANIFEST_DIR"))
@ -869,3 +871,16 @@ async fn test_users(client: &SzurubooruClient) {
.await
.expect("Could not delete token");
}
#[instrument(skip(client))]
async fn test_snapshots(client: &SzurubooruClient) {
info!("Testing snapshots");
info!("Listing snapshots");
let snap_list = client
.request()
.list_snapshots(None)
.await
.expect("Could not list snapshots");
assert!(snap_list.total > 0);
}