✨ qBittorrent: identifiants optionnels via bypass d'authentification (pas d'API key native)
This commit is contained in:
1 parent
95e5ead67a
commit
e8bbbc7d1e
5 files changed
+57
-18
No files matched your search
@@ -102,6 +102,28 @@ def test_qbittorrent_connection_local_address_with_port() -> None:
|
||||
assert test.json()["version"] == "v5.0.2"
|
||||
|
||||
|
||||
@respx.mock
|
||||
def test_qbittorrent_connection_without_credentials() -> None:
|
||||
"""Sans identifiants (bypass d'authentification qBittorrent): aucun login,
|
||||
l'API est appelee directement."""
|
||||
respx.post("http://192.168.1.50:8555/api/v2/auth/login").mock(
|
||||
return_value=Response(404)
|
||||
)
|
||||
respx.get("http://192.168.1.50:8555/api/v2/app/version").mock(
|
||||
return_value=Response(200, text="v5.0.2")
|
||||
)
|
||||
with TestClient(app) as client:
|
||||
put = client.put(
|
||||
"/api/settings/qbittorrent",
|
||||
json={"url": "192.168.1.50", "port": 8555, "username": "", "password": None},
|
||||
)
|
||||
assert put.status_code == 200
|
||||
assert put.json()["password_configured"] is False
|
||||
test = client.post("/api/settings/qbittorrent/test")
|
||||
assert test.status_code == 200
|
||||
assert test.json()["version"] == "v5.0.2"
|
||||
|
||||
|
||||
def test_settings_persist_to_conf_json() -> None:
|
||||
with TestClient(app) as client:
|
||||
put = client.put(
|
||||
|
||||
Reference in new issue
Block a user