clan-core/pkgs/clan-cli/tests/test_flakes_cli.py
DavHau 999ad67277
All checks were successful
checks-impure / test (pull_request) Successful in 1m31s
checks / test (pull_request) Successful in 2m3s
api/flake/add: init
Adds an endpoint to memoize clans.
clan flakes can be added to the history either via the endpoint or by executing `clan flakes add`
2023-11-17 17:05:15 +07:00

27 lines
489 B
Python

from typing import TYPE_CHECKING
from cli import Cli
from fixtures_flakes import FlakeForTest
from clan_cli.dirs import user_history_file
if TYPE_CHECKING:
pass
def test_flakes_add(
test_flake: FlakeForTest,
) -> None:
cli = Cli()
cmd = [
"flakes",
"add",
str(test_flake.path),
]
cli.run(cmd)
history_file = user_history_file()
assert history_file.exists()
assert open(history_file).read().strip() == str(test_flake.path)