Working test_create_flake

This commit is contained in:
Luis Hebendanz 2023-10-20 01:20:40 +02:00
parent 26bfb793b1
commit 59393bb35e
3 changed files with 9 additions and 10 deletions

View File

@ -306,11 +306,6 @@ def register_parser(
# inject callback function to process the input later
parser.set_defaults(func=get_or_set_option)
parser.add_argument(
"flake",
type=str,
help="name of the flake to set machine options for",
)
parser.add_argument(
"--machine",
"-m",
@ -354,7 +349,11 @@ def register_parser(
nargs="*",
help="option value to set (if omitted, the current value is printed)",
)
parser.add_argument(
"flake",
type=str,
help="name of the flake to set machine options for",
)
def main(argv: Optional[list[str]] = None) -> None:
if argv is None:

View File

@ -80,9 +80,9 @@ def create_flake(
@pytest.fixture
def test_flake(
monkeypatch: pytest.MonkeyPatch, temporary_dir: Path
monkeypatch: pytest.MonkeyPatch, temporary_home: Path
) -> Iterator[FlakeForTest]:
yield from create_flake(monkeypatch, temporary_dir, FlakeName("test_flake"))
yield from create_flake(monkeypatch, temporary_home, FlakeName("test_flake"))
@pytest.fixture

View File

@ -65,6 +65,6 @@ def test_create_flake(
pytest.fail("nixosConfigurations.machine1 not found in flake outputs")
# configure machine1
capsys.readouterr()
cli.run(["config", "--machine", "machine1", "services.openssh.enable"])
cli.run(["config", "--machine", "machine1", "services.openssh.enable", "", flake_name])
capsys.readouterr()
cli.run(["config", "--machine", "machine1", "services.openssh.enable", "true"])
cli.run(["config", "--machine", "machine1", "services.openssh.enable", "true", flake_name])