test: satisfy clippy assert_is_empty
Stable 1.99 added the lint and CI denies warnings, which failed the build and skipped the deploy. Each flagged assert now uses the assert_eq! form clippy suggests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1b6dae676a
commit
ee7f05bf22
@@ -319,7 +319,7 @@ mod tests {
|
|||||||
.json()
|
.json()
|
||||||
.await
|
.await
|
||||||
.expect("alice json");
|
.expect("alice json");
|
||||||
assert!(alice_view.is_empty());
|
assert_eq!(alice_view, [] as [serde_json::Value; 0]);
|
||||||
|
|
||||||
let bob_view: Vec<serde_json::Value> =
|
let bob_view: Vec<serde_json::Value> =
|
||||||
reqwest::get(format!("{base}/api/movies?owner_id={bob_id}"))
|
reqwest::get(format!("{base}/api/movies?owner_id={bob_id}"))
|
||||||
|
|||||||
@@ -946,7 +946,7 @@ mod tests {
|
|||||||
assert_eq!(response.status(), StatusCode::OK);
|
assert_eq!(response.status(), StatusCode::OK);
|
||||||
assert_eq!(stored_path(&base, 1).await, new.to_str().expect("utf-8"));
|
assert_eq!(stored_path(&base, 1).await, new.to_str().expect("utf-8"));
|
||||||
assert!(!new.exists(), "nothing was created on disk");
|
assert!(!new.exists(), "nothing was created on disk");
|
||||||
assert!(file_paths(&state).await.is_empty());
|
assert_eq!(file_paths(&state).await, [] as [std::string::String; 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Issue #236: a destination already holding a folder of that name is a
|
/// Issue #236: a destination already holding a folder of that name is a
|
||||||
|
|||||||
@@ -1224,7 +1224,10 @@ mod tests {
|
|||||||
let body: serde_json::Value = response.json().await.expect("json");
|
let body: serde_json::Value = response.json().await.expect("json");
|
||||||
assert_eq!(body["library"][0]["kind"], "movie");
|
assert_eq!(body["library"][0]["kind"], "movie");
|
||||||
assert_eq!(body["library"][0]["title"], "Dune");
|
assert_eq!(body["library"][0]["title"], "Dune");
|
||||||
assert!(body["tmdb"].as_array().expect("tmdb").is_empty());
|
assert_eq!(
|
||||||
|
body["tmdb"].as_array().expect("tmdb").as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
assert_eq!(body["tmdb_status"], "unavailable");
|
assert_eq!(body["tmdb_status"], "unavailable");
|
||||||
drop(dir);
|
drop(dir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3517,7 +3517,7 @@ mod tests {
|
|||||||
.json()
|
.json()
|
||||||
.await
|
.await
|
||||||
.expect("json");
|
.expect("json");
|
||||||
assert!(empty.is_empty());
|
assert_eq!(empty, [] as [serde_json::Value; 0]);
|
||||||
|
|
||||||
let tagged = reqwest::Client::new()
|
let tagged = reqwest::Client::new()
|
||||||
.put(format!("{base}/api/series/{series_id}/owners/{owner_id}"))
|
.put(format!("{base}/api/series/{series_id}/owners/{owner_id}"))
|
||||||
@@ -3557,7 +3557,7 @@ mod tests {
|
|||||||
.json()
|
.json()
|
||||||
.await
|
.await
|
||||||
.expect("json");
|
.expect("json");
|
||||||
assert!(owners.is_empty());
|
assert_eq!(owners, [] as [serde_json::Value; 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
@@ -2225,10 +2225,13 @@ mod tests {
|
|||||||
// No grab record backs this file, so nothing can claim its release
|
// No grab record backs this file, so nothing can claim its release
|
||||||
// name — the chip reads "no", never "unknown".
|
// name — the chip reads "no", never "unknown".
|
||||||
assert_eq!(candidates[0]["release_match"], false);
|
assert_eq!(candidates[0]["release_match"], false);
|
||||||
assert!(body["provider_errors"]
|
assert_eq!(
|
||||||
.as_array()
|
body["provider_errors"]
|
||||||
.expect("errors")
|
.as_array()
|
||||||
.is_empty());
|
.expect("errors")
|
||||||
|
.as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One provider failing is not the search failing: §15 configures two.
|
/// One provider failing is not the search failing: §15 configures two.
|
||||||
@@ -2574,7 +2577,10 @@ mod tests {
|
|||||||
let (status, body) = grab(&fixture, pt()).await;
|
let (status, body) = grab(&fixture, pt()).await;
|
||||||
|
|
||||||
assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE, "{body}");
|
assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE, "{body}");
|
||||||
assert!(fixture.subtitle_rows().await.is_empty());
|
assert_eq!(
|
||||||
|
fixture.subtitle_rows().await,
|
||||||
|
[] as [arr_db::SubtitleFile; 0]
|
||||||
|
);
|
||||||
assert!(!fixture
|
assert!(!fixture
|
||||||
.folder
|
.folder
|
||||||
.join("Dune (2021) [tmdbid-438631] - [2160p][WEB-DL].pt-PT.srt")
|
.join("Dune (2021) [tmdbid-438631] - [2160p][WEB-DL].pt-PT.srt")
|
||||||
@@ -2600,7 +2606,10 @@ mod tests {
|
|||||||
|
|
||||||
assert_eq!(status, StatusCode::NOT_FOUND, "{body}");
|
assert_eq!(status, StatusCode::NOT_FOUND, "{body}");
|
||||||
assert_eq!(body["code"], "candidate_expired");
|
assert_eq!(body["code"], "candidate_expired");
|
||||||
assert!(fixture.subtitle_rows().await.is_empty());
|
assert_eq!(
|
||||||
|
fixture.subtitle_rows().await,
|
||||||
|
[] as [arr_db::SubtitleFile; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -2822,7 +2831,10 @@ mod tests {
|
|||||||
.expect("delete");
|
.expect("delete");
|
||||||
assert_eq!(response.status(), StatusCode::NO_CONTENT);
|
assert_eq!(response.status(), StatusCode::NO_CONTENT);
|
||||||
assert!(!path.exists(), "the sidecar is gone from disk");
|
assert!(!path.exists(), "the sidecar is gone from disk");
|
||||||
assert!(fixture.subtitle_rows().await.is_empty());
|
assert_eq!(
|
||||||
|
fixture.subtitle_rows().await,
|
||||||
|
[] as [arr_db::SubtitleFile; 0]
|
||||||
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
fixture.attempt_state("pt-PT").await.as_deref(),
|
fixture.attempt_state("pt-PT").await.as_deref(),
|
||||||
Some("wanted")
|
Some("wanted")
|
||||||
@@ -2923,10 +2935,13 @@ mod tests {
|
|||||||
let statuses = status(&format!("{}/api/movies/1/subtitles/status", fixture.base)).await;
|
let statuses = status(&format!("{}/api/movies/1/subtitles/status", fixture.base)).await;
|
||||||
assert_eq!(statuses.len(), 1);
|
assert_eq!(statuses.len(), 1);
|
||||||
assert_eq!(statuses[0]["media_file_id"], 1);
|
assert_eq!(statuses[0]["media_file_id"], 1);
|
||||||
assert!(statuses[0]["subtitles"]
|
assert_eq!(
|
||||||
.as_array()
|
statuses[0]["subtitles"]
|
||||||
.expect("subtitles")
|
.as_array()
|
||||||
.is_empty());
|
.expect("subtitles")
|
||||||
|
.as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
let missing = statuses[0]["missing"].as_array().expect("missing");
|
let missing = statuses[0]["missing"].as_array().expect("missing");
|
||||||
assert_eq!(missing.len(), 2, "{missing:?}");
|
assert_eq!(missing.len(), 2, "{missing:?}");
|
||||||
assert_eq!(missing[0]["language"], "pt-PT");
|
assert_eq!(missing[0]["language"], "pt-PT");
|
||||||
@@ -3108,10 +3123,13 @@ mod tests {
|
|||||||
fixture.probe(serde_json::json!(["en", "pt-PT"])).await;
|
fixture.probe(serde_json::json!(["en", "pt-PT"])).await;
|
||||||
|
|
||||||
let statuses = status(&format!("{}/api/movies/1/subtitles/status", fixture.base)).await;
|
let statuses = status(&format!("{}/api/movies/1/subtitles/status", fixture.base)).await;
|
||||||
assert!(statuses[0]["embedded_tracks"]
|
assert_eq!(
|
||||||
.as_array()
|
statuses[0]["embedded_tracks"]
|
||||||
.expect("embedded_tracks")
|
.as_array()
|
||||||
.is_empty());
|
.expect("embedded_tracks")
|
||||||
|
.as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The issue's whole point: nothing is missing on this file, so the
|
/// The issue's whole point: nothing is missing on this file, so the
|
||||||
@@ -3223,7 +3241,10 @@ mod tests {
|
|||||||
|
|
||||||
let (status, body) = extract(&fixture, 0).await;
|
let (status, body) = extract(&fixture, 0).await;
|
||||||
assert_eq!(status, StatusCode::UNPROCESSABLE_ENTITY, "{body}");
|
assert_eq!(status, StatusCode::UNPROCESSABLE_ENTITY, "{body}");
|
||||||
assert!(fixture.subtitle_rows().await.is_empty());
|
assert_eq!(
|
||||||
|
fixture.subtitle_rows().await,
|
||||||
|
[] as [arr_db::SubtitleFile; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -3268,8 +3289,14 @@ mod tests {
|
|||||||
async fn subtitle_queue_omits_titles_with_no_gaps() {
|
async fn subtitle_queue_omits_titles_with_no_gaps() {
|
||||||
let fixture = stub_application().await;
|
let fixture = stub_application().await;
|
||||||
let body = queue(&fixture.base).await;
|
let body = queue(&fixture.base).await;
|
||||||
assert!(body["movies"].as_array().expect("movies").is_empty());
|
assert_eq!(
|
||||||
assert!(body["series"].as_array().expect("series").is_empty());
|
body["movies"].as_array().expect("movies").as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
body["series"].as_array().expect("series").as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// #202: an attempt row for a language no longer in the wanted set is
|
/// #202: an attempt row for a language no longer in the wanted set is
|
||||||
@@ -3292,7 +3319,10 @@ mod tests {
|
|||||||
.expect("narrow wanted set");
|
.expect("narrow wanted set");
|
||||||
|
|
||||||
let body = queue(&fixture.base).await;
|
let body = queue(&fixture.base).await;
|
||||||
assert!(body["movies"].as_array().expect("movies").is_empty());
|
assert_eq!(
|
||||||
|
body["movies"].as_array().expect("movies").as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// #202: a movie's failed attempt surfaces with its language and detail.
|
/// #202: a movie's failed attempt surfaces with its language and detail.
|
||||||
@@ -3418,10 +3448,13 @@ mod tests {
|
|||||||
let body = queue(&fixture.base).await;
|
let body = queue(&fixture.base).await;
|
||||||
let series = body["series"].as_array().expect("series");
|
let series = body["series"].as_array().expect("series");
|
||||||
assert_eq!(series.len(), 1, "{series:?}");
|
assert_eq!(series.len(), 1, "{series:?}");
|
||||||
assert!(series[0]["episodes"]
|
assert_eq!(
|
||||||
.as_array()
|
series[0]["episodes"]
|
||||||
.expect("episodes")
|
.as_array()
|
||||||
.is_empty());
|
.expect("episodes")
|
||||||
|
.as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
let seasons = series[0]["seasons"].as_array().expect("seasons");
|
let seasons = series[0]["seasons"].as_array().expect("seasons");
|
||||||
assert_eq!(seasons.len(), 1, "{seasons:?}");
|
assert_eq!(seasons.len(), 1, "{seasons:?}");
|
||||||
assert_eq!(seasons[0]["season_number"], 1);
|
assert_eq!(seasons[0]["season_number"], 1);
|
||||||
@@ -3475,7 +3508,10 @@ mod tests {
|
|||||||
let body = queue(&fixture.base).await;
|
let body = queue(&fixture.base).await;
|
||||||
let series = body["series"].as_array().expect("series");
|
let series = body["series"].as_array().expect("series");
|
||||||
assert_eq!(series.len(), 1, "{series:?}");
|
assert_eq!(series.len(), 1, "{series:?}");
|
||||||
assert!(series[0]["seasons"].as_array().expect("seasons").is_empty());
|
assert_eq!(
|
||||||
|
series[0]["seasons"].as_array().expect("seasons").as_slice(),
|
||||||
|
[] as [serde_json::Value; 0]
|
||||||
|
);
|
||||||
let episodes = series[0]["episodes"].as_array().expect("episodes");
|
let episodes = series[0]["episodes"].as_array().expect("episodes");
|
||||||
assert_eq!(episodes.len(), 2, "{episodes:?}");
|
assert_eq!(episodes.len(), 2, "{episodes:?}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1904,7 +1904,7 @@ mod tests {
|
|||||||
action.tick(&database).await.unwrap();
|
action.tick(&database).await.unwrap();
|
||||||
let outcomes = action.tick(&database).await.unwrap();
|
let outcomes = action.tick(&database).await.unwrap();
|
||||||
|
|
||||||
assert!(outcomes.is_empty());
|
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||||
assert_eq!(fake.torrents().len(), 1);
|
assert_eq!(fake.torrents().len(), 1);
|
||||||
assert_eq!(grabs(&database).await.len(), 1);
|
assert_eq!(grabs(&database).await.len(), 1);
|
||||||
}
|
}
|
||||||
@@ -2163,7 +2163,7 @@ mod tests {
|
|||||||
|
|
||||||
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||||
|
|
||||||
assert!(outcomes.is_empty());
|
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||||
assert!(fake.torrents().is_empty());
|
assert!(fake.torrents().is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2244,7 +2244,10 @@ mod tests {
|
|||||||
|
|
||||||
action(&indexer, &downloader).tick(&database).await.unwrap();
|
action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||||
|
|
||||||
assert!(grabs(&database).await.is_empty());
|
assert_eq!(
|
||||||
|
grabs(&database).await,
|
||||||
|
[] as [(i64, std::string::String, std::string::String); 0]
|
||||||
|
);
|
||||||
assert!(
|
assert!(
|
||||||
fake.torrents().is_empty(),
|
fake.torrents().is_empty(),
|
||||||
"a torrent added this tick and then found blacklisted is removed"
|
"a torrent added this tick and then found blacklisted is removed"
|
||||||
@@ -2311,7 +2314,10 @@ mod tests {
|
|||||||
assert_eq!(targeted_searches(&indexer).await, 1);
|
assert_eq!(targeted_searches(&indexer).await, 1);
|
||||||
assert_eq!(deck(&database).await.len(), 3, "every candidate is cached");
|
assert_eq!(deck(&database).await.len(), 3, "every candidate is cached");
|
||||||
assert!(fake.torrents().is_empty());
|
assert!(fake.torrents().is_empty());
|
||||||
assert!(grabs(&database).await.is_empty());
|
assert_eq!(
|
||||||
|
grabs(&database).await,
|
||||||
|
[] as [(i64, std::string::String, std::string::String); 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The digital-release gate belongs to targeted search (§6.2). A movie
|
/// The digital-release gate belongs to targeted search (§6.2). A movie
|
||||||
@@ -2385,7 +2391,10 @@ mod tests {
|
|||||||
|
|
||||||
assert!(outcome.is_none());
|
assert!(outcome.is_none());
|
||||||
assert_eq!(targeted_searches(&indexer).await, 0);
|
assert_eq!(targeted_searches(&indexer).await, 0);
|
||||||
assert!(deck(&database).await.is_empty());
|
assert_eq!(
|
||||||
|
deck(&database).await,
|
||||||
|
[] as [(std::string::String, std::string::String); 0]
|
||||||
|
);
|
||||||
assert!(fake.torrents().is_empty());
|
assert!(fake.torrents().is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2402,9 +2411,12 @@ mod tests {
|
|||||||
|
|
||||||
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||||
|
|
||||||
assert!(outcomes.is_empty());
|
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||||
assert!(fake.torrents().is_empty());
|
assert!(fake.torrents().is_empty());
|
||||||
assert!(grabs(&database).await.is_empty());
|
assert_eq!(
|
||||||
|
grabs(&database).await,
|
||||||
|
[] as [(i64, std::string::String, std::string::String); 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
@@ -1835,7 +1835,7 @@ mod tests {
|
|||||||
|
|
||||||
let outcomes = h.action.tick(&h.database).await.unwrap();
|
let outcomes = h.action.tick(&h.database).await.unwrap();
|
||||||
|
|
||||||
assert!(outcomes.is_empty());
|
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// #108, overriding §86: a `downloaded` grab whose torrent qBittorrent
|
/// #108, overriding §86: a `downloaded` grab whose torrent qBittorrent
|
||||||
|
|||||||
@@ -171,7 +171,10 @@ mod tests {
|
|||||||
let action = ReaperAction::new(QbitClient::new(&server.uri()).unwrap());
|
let action = ReaperAction::new(QbitClient::new(&server.uri()).unwrap());
|
||||||
|
|
||||||
let labels = HashSet::from(["movies-main".to_owned()]);
|
let labels = HashSet::from(["movies-main".to_owned()]);
|
||||||
assert!(action.tick(&labels).await.unwrap().is_empty());
|
assert_eq!(
|
||||||
|
action.tick(&labels).await.unwrap(),
|
||||||
|
[] as [crate::reconcile::Outcome; 0]
|
||||||
|
);
|
||||||
assert!(deleted.lock().unwrap().is_empty());
|
assert!(deleted.lock().unwrap().is_empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -983,9 +983,12 @@ mod tests {
|
|||||||
|
|
||||||
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||||
|
|
||||||
assert!(outcomes.is_empty());
|
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||||
assert!(fake.added.lock().unwrap().is_empty());
|
assert!(fake.added.lock().unwrap().is_empty());
|
||||||
assert!(stored_releases(&database).await.is_empty());
|
assert_eq!(
|
||||||
|
stored_releases(&database).await,
|
||||||
|
[] as [std::string::String; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// §6.2: RSS never backs off, so nothing it does may spend one of
|
/// §6.2: RSS never backs off, so nothing it does may spend one of
|
||||||
|
|||||||
@@ -998,7 +998,7 @@ mod tests {
|
|||||||
let after_first = server.received_requests().await.unwrap().len();
|
let after_first = server.received_requests().await.unwrap().len();
|
||||||
|
|
||||||
let second = action(&server).tick(&database).await.unwrap();
|
let second = action(&server).tick(&database).await.unwrap();
|
||||||
assert!(second.is_empty());
|
assert_eq!(second, [] as [crate::reconcile::Outcome; 0]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
server.received_requests().await.unwrap().len(),
|
server.received_requests().await.unwrap().len(),
|
||||||
after_first,
|
after_first,
|
||||||
|
|||||||
@@ -1053,7 +1053,10 @@ mod tests {
|
|||||||
assert_eq!(row.sync, SubtitleSync::Rejected);
|
assert_eq!(row.sync, SubtitleSync::Rejected);
|
||||||
|
|
||||||
delete_file(db.pool(), id).await.unwrap();
|
delete_file(db.pool(), id).await.unwrap();
|
||||||
assert!(files_for(db.pool(), file).await.unwrap().is_empty());
|
assert_eq!(
|
||||||
|
files_for(db.pool(), file).await.unwrap(),
|
||||||
|
[] as [crate::subtitles::SubtitleFile; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1244,8 +1247,14 @@ mod tests {
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
assert!(files_for(db.pool(), file).await.unwrap().is_empty());
|
assert_eq!(
|
||||||
assert!(attempts_for(db.pool(), file).await.unwrap().is_empty());
|
files_for(db.pool(), file).await.unwrap(),
|
||||||
|
[] as [crate::subtitles::SubtitleFile; 0]
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
attempts_for(db.pool(), file).await.unwrap(),
|
||||||
|
[] as [crate::subtitles::SubtitleAttempt; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1273,7 +1282,10 @@ mod unsatisfy_tests {
|
|||||||
async fn a_deleted_subtitle_puts_its_language_back_in_the_work_list() {
|
async fn a_deleted_subtitle_puts_its_language_back_in_the_work_list() {
|
||||||
let (db, _dir, file) = file().await;
|
let (db, _dir, file) = file().await;
|
||||||
mark_satisfied(db.pool(), file, "pt-PT").await.unwrap();
|
mark_satisfied(db.pool(), file, "pt-PT").await.unwrap();
|
||||||
assert!(pending(db.pool(), 10).await.unwrap().is_empty());
|
assert_eq!(
|
||||||
|
pending(db.pool(), 10).await.unwrap(),
|
||||||
|
[] as [crate::subtitles::PendingSubtitle; 0]
|
||||||
|
);
|
||||||
|
|
||||||
unsatisfy(db.pool(), file, "pt-PT").await.unwrap();
|
unsatisfy(db.pool(), file, "pt-PT").await.unwrap();
|
||||||
|
|
||||||
@@ -1306,7 +1318,10 @@ mod unsatisfy_tests {
|
|||||||
async fn an_untracked_language_is_left_alone() {
|
async fn an_untracked_language_is_left_alone() {
|
||||||
let (db, _dir, file) = file().await;
|
let (db, _dir, file) = file().await;
|
||||||
unsatisfy(db.pool(), file, "es").await.unwrap();
|
unsatisfy(db.pool(), file, "es").await.unwrap();
|
||||||
assert!(attempts_for(db.pool(), file).await.unwrap().is_empty());
|
assert_eq!(
|
||||||
|
attempts_for(db.pool(), file).await.unwrap(),
|
||||||
|
[] as [crate::subtitles::SubtitleAttempt; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Only a satisfied claim is withdrawn: a language the loop has already
|
/// Only a satisfied claim is withdrawn: a language the loop has already
|
||||||
|
|||||||
@@ -724,8 +724,14 @@ mod tests {
|
|||||||
|
|
||||||
let client =
|
let client =
|
||||||
QbitClient::with_credentials(&server.uri(), "user".into(), "pass".into()).unwrap();
|
QbitClient::with_credentials(&server.uri(), "user".into(), "pass".into()).unwrap();
|
||||||
assert!(client.list_torrents().await.unwrap().is_empty());
|
assert_eq!(
|
||||||
assert!(client.list_torrents().await.unwrap().is_empty());
|
client.list_torrents().await.unwrap(),
|
||||||
|
[] as [crate::Torrent; 0]
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
client.list_torrents().await.unwrap(),
|
||||||
|
[] as [crate::Torrent; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An instance that bypasses authentication for arr's address answers
|
/// An instance that bypasses authentication for arr's address answers
|
||||||
@@ -748,7 +754,10 @@ mod tests {
|
|||||||
|
|
||||||
let client =
|
let client =
|
||||||
QbitClient::with_credentials(&server.uri(), "user".into(), "stale".into()).unwrap();
|
QbitClient::with_credentials(&server.uri(), "user".into(), "stale".into()).unwrap();
|
||||||
assert!(client.list_torrents().await.unwrap().is_empty());
|
assert_eq!(
|
||||||
|
client.list_torrents().await.unwrap(),
|
||||||
|
[] as [crate::Torrent; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1072,6 +1081,9 @@ mod tests {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
let client = QbitClient::new(&format!("{}/qbt", server.uri())).unwrap();
|
let client = QbitClient::new(&format!("{}/qbt", server.uri())).unwrap();
|
||||||
assert!(client.list_torrents().await.unwrap().is_empty());
|
assert_eq!(
|
||||||
|
client.list_torrents().await.unwrap(),
|
||||||
|
[] as [crate::Torrent; 0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -707,7 +707,10 @@ mod tests {
|
|||||||
);
|
);
|
||||||
assert_eq!(searches[2].error, None);
|
assert_eq!(searches[2].error, None);
|
||||||
|
|
||||||
assert!(searches[3].releases.is_empty());
|
assert_eq!(
|
||||||
|
searches[3].releases,
|
||||||
|
[] as [crate::search::SearchRelease; 0]
|
||||||
|
);
|
||||||
assert_eq!(searches[3].error, Some(SearchError::InvalidResponse));
|
assert_eq!(searches[3].error, Some(SearchError::InvalidResponse));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ async fn unreleased_movie_has_no_dates_and_no_imdb_id() {
|
|||||||
assert_eq!(movie.digital_release, None);
|
assert_eq!(movie.digital_release, None);
|
||||||
assert_eq!(movie.imdb_id, None);
|
assert_eq!(movie.imdb_id, None);
|
||||||
assert_eq!(movie.runtime, None);
|
assert_eq!(movie.runtime, None);
|
||||||
assert!(movie.origin_countries.is_empty());
|
assert_eq!(movie.origin_countries, [] as [std::string::String; 0]);
|
||||||
// TMDB reports vote_average: 0 for an unrated title — absence, not zero
|
// TMDB reports vote_average: 0 for an unrated title — absence, not zero
|
||||||
// (#156), so it is normalised away like any other zero-valued null.
|
// (#156), so it is normalised away like any other zero-valued null.
|
||||||
assert_eq!(movie.vote_average, None);
|
assert_eq!(movie.vote_average, None);
|
||||||
@@ -537,7 +537,7 @@ async fn find_by_imdb_resolves_series() {
|
|||||||
.await
|
.await
|
||||||
.expect("lookup succeeds");
|
.expect("lookup succeeds");
|
||||||
|
|
||||||
assert!(results.movies.is_empty());
|
assert_eq!(results.movies, [] as [arr_meta::MovieSearchResult; 0]);
|
||||||
assert_eq!(results.series.len(), 1);
|
assert_eq!(results.series.len(), 1);
|
||||||
let series = &results.series[0];
|
let series = &results.series[0];
|
||||||
assert_eq!(series.tmdb_id, 82_728);
|
assert_eq!(series.tmdb_id, 82_728);
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ mod tests {
|
|||||||
fn the_template_splits_on_whitespace() {
|
fn the_template_splits_on_whitespace() {
|
||||||
assert_eq!(argv("ssh box claude -p"), ["ssh", "box", "claude", "-p"]);
|
assert_eq!(argv("ssh box claude -p"), ["ssh", "box", "claude", "-p"]);
|
||||||
assert_eq!(argv(" claude "), ["claude"]);
|
assert_eq!(argv(" claude "), ["claude"]);
|
||||||
assert!(argv(" ").is_empty());
|
assert_eq!(argv(" "), [] as [std::string::String; 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// #225: a fresh verdict is served straight from the cache; a stale one
|
/// #225: a fresh verdict is served straight from the cache; a stale one
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ mod tests {
|
|||||||
.await
|
.await
|
||||||
.expect("nothing to send");
|
.expect("nothing to send");
|
||||||
|
|
||||||
assert!(translated.is_empty());
|
assert_eq!(translated, [] as [crate::srt::Cue; 0]);
|
||||||
assert_eq!(backend.calls.load(Ordering::SeqCst), 0);
|
assert_eq!(backend.calls.load(Ordering::SeqCst), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user