forked from clan/clan-core
Fixed pytest
This commit is contained in:
parent
0358bf2d30
commit
9a81bc1d4e
@ -4,48 +4,10 @@ import logging
|
|||||||
import pytest
|
import pytest
|
||||||
from api import TestClient
|
from api import TestClient
|
||||||
from fixtures_flakes import FlakeForTest
|
from fixtures_flakes import FlakeForTest
|
||||||
from path import Path
|
|
||||||
|
|
||||||
from clan_cli.dirs import user_history_file
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
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
|
@pytest.mark.impure
|
||||||
def test_inspect_ok(api: TestClient, test_flake_with_core: FlakeForTest) -> None:
|
def test_inspect_ok(api: TestClient, test_flake_with_core: FlakeForTest) -> None:
|
||||||
params = {"url": str(test_flake_with_core.path)}
|
params = {"url": str(test_flake_with_core.path)}
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
import json
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from cli import Cli
|
from cli import Cli
|
||||||
from fixtures_flakes import FlakeForTest
|
from fixtures_flakes import FlakeForTest
|
||||||
from pytest import CaptureFixture
|
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.impure
|
@pytest.mark.impure
|
||||||
def test_flakes_inspect(
|
def test_flakes_inspect(
|
||||||
test_flake_with_core: FlakeForTest, capsys: pytest.CaptureFixture
|
test_flake_with_core: FlakeForTest, capsys: pytest.CaptureFixture
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import pytest
|
|
||||||
from cli import Cli
|
from cli import Cli
|
||||||
from fixtures_flakes import FlakeForTest
|
from fixtures_flakes import FlakeForTest
|
||||||
from pytest import CaptureFixture
|
from pytest import CaptureFixture
|
||||||
@ -47,5 +46,3 @@ def test_history_list(
|
|||||||
cli.run(["history", "add", str(test_flake.path)])
|
cli.run(["history", "add", str(test_flake.path)])
|
||||||
cli.run(cmd)
|
cli.run(cmd)
|
||||||
assert str(test_flake.path) in capsys.readouterr().out
|
assert str(test_flake.path) in capsys.readouterr().out
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user