forked from clan/clan-core
fix: tests
This commit is contained in:
parent
691ae9fb15
commit
3998efac78
@ -16,7 +16,10 @@ def test_machine_subcommands(
|
|||||||
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
|
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
|
||||||
|
|
||||||
out = capsys.readouterr()
|
out = capsys.readouterr()
|
||||||
assert "machine1\nvm1\nvm2\n" == out.out
|
|
||||||
|
assert "machine1" in out.out
|
||||||
|
assert "nvm1" in out.out
|
||||||
|
assert "nvm2" 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"]
|
||||||
@ -25,4 +28,7 @@ def test_machine_subcommands(
|
|||||||
capsys.readouterr()
|
capsys.readouterr()
|
||||||
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
|
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
|
||||||
out = capsys.readouterr()
|
out = capsys.readouterr()
|
||||||
assert "vm1\nvm2\n" == out.out
|
|
||||||
|
assert "machine1" not in out.out
|
||||||
|
assert "nvm1" in out.out
|
||||||
|
assert "nvm2" in out.out
|
||||||
|
@ -32,7 +32,7 @@ def dataclass_to_dict(obj: Any) -> Any:
|
|||||||
"""
|
"""
|
||||||
if dataclasses.is_dataclass(obj):
|
if dataclasses.is_dataclass(obj):
|
||||||
return {k: dataclass_to_dict(v) for k, v in dataclasses.asdict(obj).items()}
|
return {k: dataclass_to_dict(v) for k, v in dataclasses.asdict(obj).items()}
|
||||||
elif isinstance(obj, (list, tuple)):
|
elif isinstance(obj, list | tuple):
|
||||||
return [dataclass_to_dict(item) for item in obj]
|
return [dataclass_to_dict(item) for item in obj]
|
||||||
elif isinstance(obj, dict):
|
elif isinstance(obj, dict):
|
||||||
return {k: dataclass_to_dict(v) for k, v in obj.items()}
|
return {k: dataclass_to_dict(v) for k, v in obj.items()}
|
||||||
|
@ -28,7 +28,7 @@ export const Nested: Component = () => {
|
|||||||
{(entry, i) => (
|
{(entry, i) => (
|
||||||
<li>
|
<li>
|
||||||
{i() + 1}: {entry.machineName}{" "}
|
{i() + 1}: {entry.machineName}{" "}
|
||||||
{entry.machineDescription || "No description"}
|
{entry.machine_description || "No description"}
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
|
Loading…
Reference in New Issue
Block a user