api: fix breaking tests
This commit is contained in:
@@ -26,6 +26,14 @@ def test_create_flake(
|
|||||||
cli.run(["machines", "create", "machine1"])
|
cli.run(["machines", "create", "machine1"])
|
||||||
capsys.readouterr() # flush cache
|
capsys.readouterr() # flush cache
|
||||||
|
|
||||||
|
# create a hardware-configuration.nix that doesn't throw an eval error
|
||||||
|
|
||||||
|
for patch_machine in ["jon", "sara"]:
|
||||||
|
with open(
|
||||||
|
flake_dir / "machines" / f"{patch_machine}/hardware-configuration.nix", "w"
|
||||||
|
) as hw_config_nix:
|
||||||
|
hw_config_nix.write("{}")
|
||||||
|
|
||||||
cli.run(["machines", "list"])
|
cli.run(["machines", "list"])
|
||||||
assert "machine1" in capsys.readouterr().out
|
assert "machine1" in capsys.readouterr().out
|
||||||
flake_show = subprocess.run(
|
flake_show = subprocess.run(
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ def test_machine_subcommands(
|
|||||||
out = capsys.readouterr()
|
out = capsys.readouterr()
|
||||||
|
|
||||||
assert "machine1" in out.out
|
assert "machine1" in out.out
|
||||||
assert "nvm1" in out.out
|
assert "vm1" in out.out
|
||||||
assert "nvm2" in out.out
|
assert "vm2" in out.out
|
||||||
|
|
||||||
cli.run(
|
cli.run(
|
||||||
["--flake", str(test_flake_with_core.path), "machines", "delete", "machine1"]
|
["--flake", str(test_flake_with_core.path), "machines", "delete", "machine1"]
|
||||||
@@ -30,5 +30,5 @@ def test_machine_subcommands(
|
|||||||
out = capsys.readouterr()
|
out = capsys.readouterr()
|
||||||
|
|
||||||
assert "machine1" not in out.out
|
assert "machine1" not in out.out
|
||||||
assert "nvm1" in out.out
|
assert "vm1" in out.out
|
||||||
assert "nvm2" in out.out
|
assert "vm2" in out.out
|
||||||
|
|||||||
Reference in New Issue
Block a user