Fixed failing tests in machines and history cli, removed test_machines_api.py

This commit is contained in:
Qubasa
2023-12-14 18:25:42 +01:00
parent 67be1d1977
commit 30cd375d98
9 changed files with 45 additions and 295 deletions

View File

@@ -3,20 +3,25 @@ from cli import Cli
from fixtures_flakes import FlakeForTest
@pytest.mark.impure
def test_machine_subcommands(
test_flake: FlakeForTest, capsys: pytest.CaptureFixture
test_flake_with_core: FlakeForTest, capsys: pytest.CaptureFixture
) -> None:
cli = Cli()
cli.run(["--flake", str(test_flake.path), "machines", "create", "machine1"])
cli.run(
["--flake", str(test_flake_with_core.path), "machines", "create", "machine1"]
)
capsys.readouterr()
cli.run(["--flake", str(test_flake.path), "machines", "list"])
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
out = capsys.readouterr()
assert "machine1\n" == out.out
assert "machine1\nvm1\nvm2\n" == out.out
cli.run(["--flake", str(test_flake.path), "machines", "delete", "machine1"])
cli.run(
["--flake", str(test_flake_with_core.path), "machines", "delete", "machine1"]
)
capsys.readouterr()
cli.run(["--flake", str(test_flake.path), "machines", "list"])
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
out = capsys.readouterr()
assert "" == out.out
assert "vm1\nvm2\n" == out.out