test(integration-test): testing snapshot fetching
This commit is contained in:
parent
ada4a7733c
commit
6d840de69f
3 changed files with 16 additions and 72 deletions
|
|
@ -5,6 +5,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
chrono = "0.4.38"
|
||||
sha1 = "0.10.6"
|
||||
szurubooru-client = { path = "../szurubooru-client" }
|
||||
tokio = { version = "1.39.2", features = ["full", "test-util", "tracing"] }
|
||||
tracing = "0.1.40"
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue