Working test_create_flake
This commit is contained in:
parent
26bfb793b1
commit
59393bb35e
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user