Beyoncé rule
Some checks failed
checks-impure / test (pull_request) Successful in 13s
checks / test (pull_request) Failing after 1m23s

This commit is contained in:
Johannes Kirschbauer 2023-10-03 11:17:40 +02:00
parent 3c11eece4d
commit 16f44900a3
Signed by: hsjobeki
GPG Key ID: F62ED8B8BF204685

View File

@ -5,7 +5,7 @@ from api import TestClient
@pytest.mark.impure
def test_inspect(api: TestClient, test_flake_with_core: Path) -> None:
def test_inspect_ok(api: TestClient, test_flake_with_core: Path) -> None:
params = {"url": str(test_flake_with_core)}
response = api.get(
"/api/flake/attrs",
@ -15,3 +15,16 @@ def test_inspect(api: TestClient, test_flake_with_core: Path) -> None:
data = response.json()
print("Data: ", data)
assert data.get("flake_attrs") == ["vm1"]
@pytest.mark.impure
def test_inspect_err(api: TestClient) -> None:
params = {"url": "flake-parts"}
response = api.get(
"/api/flake/attrs",
params=params,
)
assert response.status_code != 200, "Succeed to inspect vm but expected to fail"
data = response.json()
print("Data: ", data)
assert data.get("detail")