feat(arr): probe methods for subtitle providers and engines

This commit is contained in:
Miguel Palhas
2026-08-25 05:54:19 +01:00
parent e0e7ddf6de
commit 8c5613b247
12 changed files with 480 additions and 14 deletions
+23
View File
@@ -282,3 +282,26 @@ async fn an_id_this_provider_never_issued_is_not_found() {
assert!(matches!(error, Error::NotFound { .. }), "got {error:?}");
}
#[tokio::test]
async fn a_probe_is_reachability_alone() {
let server = MockServer::start().await;
Mock::given(method("GET"))
.and(path("/subtitles/"))
.respond_with(ResponseTemplate::new(200))
.mount(&server)
.await;
provider(&server)
.probe()
.await
.expect("the anonymous provider is up when the site answers");
server.reset().await;
Mock::given(method("GET"))
.and(path("/subtitles/"))
.respond_with(ResponseTemplate::new(500))
.mount(&server)
.await;
let error = provider(&server).probe().await.expect_err("site down");
assert!(matches!(error, Error::Malformed { .. }), "got {error:?}");
}