1
0
forked from clan/clan-core

Fixed pytest

This commit is contained in:
Luis Hebendanz 2023-12-12 14:03:10 +01:00
parent 0358bf2d30
commit 9a81bc1d4e
3 changed files with 1 additions and 44 deletions

View File

@ -4,48 +4,10 @@ import logging
import pytest
from api import TestClient
from fixtures_flakes import FlakeForTest
from path import Path
from clan_cli.dirs import user_history_file
log = logging.getLogger(__name__)
def test_flake_history_append(
api: TestClient, test_flake: FlakeForTest, temporary_home: Path
) -> None:
response = api.post(
f"/api/flake/history?flake_dir={test_flake.path!s}",
json={},
)
assert response.status_code == 200, response.json()
assert user_history_file().exists()
# def test_flake_history_list(
# api: TestClient, test_flake: FlakeForTest, temporary_home: Path
# ) -> None:
# response = api.get(
# "/api/flake/history",
# )
# assert response.status_code == 200, response.text
# assert response.json() == []
# # add the test_flake
# response = api.post(
# f"/api/flake/history?flake_dir={test_flake.path!s}",
# json={},
# )
# assert response.status_code == 200, response.text
# # list the flakes again
# response = api.get(
# "/api/flake/history",
# )
# assert response.status_code == 200, response.text
# assert response.json() == [str(test_flake.path)]
@pytest.mark.impure
def test_inspect_ok(api: TestClient, test_flake_with_core: FlakeForTest) -> None:
params = {"url": str(test_flake_with_core.path)}

View File

@ -1,15 +1,13 @@
import json
from typing import TYPE_CHECKING
import pytest
from cli import Cli
from fixtures_flakes import FlakeForTest
from pytest import CaptureFixture
if TYPE_CHECKING:
pass
@pytest.mark.impure
def test_flakes_inspect(
test_flake_with_core: FlakeForTest, capsys: pytest.CaptureFixture

View File

@ -1,7 +1,6 @@
import json
from typing import TYPE_CHECKING
import pytest
from cli import Cli
from fixtures_flakes import FlakeForTest
from pytest import CaptureFixture
@ -47,5 +46,3 @@ def test_history_list(
cli.run(["history", "add", str(test_flake.path)])
cli.run(cmd)
assert str(test_flake.path) in capsys.readouterr().out