From 7f6684998be85d6cd63fdb973284a1be78876e00 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 27 Jun 2025 10:42:36 +0200 Subject: [PATCH] tests/create_clan: bring back read,write checks --- .../clan_cli/tests/test_clan_nix_attrset.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py index 7c80cc5fd..74030e868 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py +++ b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py @@ -112,15 +112,15 @@ def test_clan_core_templates( Path(default_template.src["path"]), new_clan, ) - assert (new_clan / "flake.nix").exists() - assert (new_clan / "machines").is_dir() - # config_nix_p = new_clan / "machines" / "jon" / "configuration.nix" - # assert (config_nix_p).is_file() + flake_file = new_clan / "flake.nix" - # Test if we can write to the configuration.nix file - # with config_nix_p.open("r+") as f: - # data = f.read() - # f.write(data) + assert (flake_file).exists() + # Test if we can read + write files after the template was copied + with flake_file.open("r+") as f: + data = f.read() + f.write(data) + + assert (new_clan / "machines").is_dir() # Test Case 1: Minimal input with empty templates