34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
def test_health_contains_build_info(tmp_path, monkeypatch):
|
|
monkeypatch.setenv("IMPORTARR_STATE_PATH", str(tmp_path / "state.db"))
|
|
import importarr.main as main
|
|
|
|
payload = main.health()
|
|
assert payload["status"] == "ok"
|
|
assert payload["name"] == "Importarr"
|
|
assert payload["version"]
|
|
|
|
|
|
def test_status_contains_service_configuration(tmp_path, monkeypatch):
|
|
monkeypatch.setenv("IMPORTARR_STATE_PATH", str(tmp_path / "state.db"))
|
|
import importarr.main as main
|
|
|
|
payload = main.status()
|
|
assert payload["build"]["name"] == "Importarr"
|
|
assert "download_root" in payload
|
|
assert "movies_root" in payload
|
|
assert "tv_root" in payload
|
|
assert "auth_enabled" in payload
|
|
|
|
|
|
def test_index_renders_queue_controls(tmp_path, monkeypatch):
|
|
monkeypatch.setenv("IMPORTARR_STATE_PATH", str(tmp_path / "state.db"))
|
|
import importarr.main as main
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
response = TestClient(main.app).get("/")
|
|
|
|
assert response.status_code == 200
|
|
assert "Queue controls" in response.text
|
|
assert "cancel-current" in response.text
|