From 2ff7820887117ffcefae8c54b4d273c4adc5d569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 11 Aug 2023 17:03:09 +0200 Subject: [PATCH 1/2] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/5a9bfa9fa612cc1888a886f6900bf7afcdfd8d92' (2023-08-07) → 'github:nix-community/disko/241c878d4b542fea7c61ed4421e9224af054ff56' (2023-08-11) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/41c7605718399dcfa53dd7083793b6ae3bc969ff' (2023-08-08) → 'github:NixOS/nixpkgs/ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e' (2023-08-10) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index dc5fa996..1808ad59 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1691423834, - "narHash": "sha256-xcjbbK7j0xbX6VvYg03mI0DbcpjtVC6FuoO5SRYLPe4=", + "lastModified": 1691743546, + "narHash": "sha256-nS2uWOeEmMgUBEMDCvwLlXBBCLkW7agDcMtOXuf9PDc=", "owner": "nix-community", "repo": "disko", - "rev": "5a9bfa9fa612cc1888a886f6900bf7afcdfd8d92", + "rev": "241c878d4b542fea7c61ed4421e9224af054ff56", "type": "github" }, "original": { @@ -98,11 +98,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1691472822, - "narHash": "sha256-XVfYZ2oB3lNPVq6sHCY9WkdQ8lHoIDzzbpg8bB6oBxA=", + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "41c7605718399dcfa53dd7083793b6ae3bc969ff", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", "type": "github" }, "original": { From 51f40a4f096c66a6ead81399430722d641374e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 11 Aug 2023 17:11:47 +0200 Subject: [PATCH 2/2] test_update_cli: also test --help --- pkgs/clan-cli/clan_cli/update.py | 1 - .../tests/{test_update.py => test_update_cli.py} | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) rename pkgs/clan-cli/tests/{test_update.py => test_update_cli.py} (79%) diff --git a/pkgs/clan-cli/clan_cli/update.py b/pkgs/clan-cli/clan_cli/update.py index 661e9613..6ab343aa 100644 --- a/pkgs/clan-cli/clan_cli/update.py +++ b/pkgs/clan-cli/clan_cli/update.py @@ -94,7 +94,6 @@ def update(args: argparse.Namespace) -> None: def register_parser(parser: argparse.ArgumentParser) -> None: - parser.add_mutually_exclusive_group(required=True) # TODO pass all args we don't parse into ssh_args, currently it fails if arg starts with - parser.add_argument("--flake-uri", type=str, default=".#", help="nix flake uri") parser.add_argument( diff --git a/pkgs/clan-cli/tests/test_update.py b/pkgs/clan-cli/tests/test_update_cli.py similarity index 79% rename from pkgs/clan-cli/tests/test_update.py rename to pkgs/clan-cli/tests/test_update_cli.py index 8d9dca9f..707283a6 100644 --- a/pkgs/clan-cli/tests/test_update.py +++ b/pkgs/clan-cli/tests/test_update_cli.py @@ -1,12 +1,21 @@ +import argparse import os import shutil from pathlib import Path from tempfile import TemporaryDirectory +import pytest from environment import mock_env from host_group import HostGroup -from clan_cli.update import deploy_nixos +from clan_cli.update import deploy_nixos, register_parser + + +def test_cli() -> None: + parser = argparse.ArgumentParser() + register_parser(parser) + with pytest.raises(SystemExit): + parser.parse_args(["--help"]) def test_update(clan_flake: Path, host_group: HostGroup) -> None: