get_clan_flake_toplevel: fix check

This commit is contained in:
Jörg Thalheim
2023-07-28 12:35:41 +02:00
parent 774d1d1219
commit 88a2c2656a
2 changed files with 9 additions and 1 deletions

View File

@@ -12,3 +12,11 @@ def test_get_clan_flake_toplevel(
monkeypatch.chdir(temporary_dir)
with pytest.raises(ClanError):
get_clan_flake_toplevel()
(temporary_dir / ".git").touch()
assert get_clan_flake_toplevel() == temporary_dir
subdir = temporary_dir / "subdir"
subdir.mkdir()
monkeypatch.chdir(subdir)
(subdir / ".clan-flake").touch()
assert get_clan_flake_toplevel() == subdir