Initial commit
This commit is contained in:
20
tests/test_plan_extras.py
Normal file
20
tests/test_plan_extras.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from pathlib import Path
|
||||
|
||||
from applepy.checks.plan_extras import _count_apps
|
||||
|
||||
|
||||
def test_count_apps_finds_dot_app(tmp_path: Path) -> None:
|
||||
apps = tmp_path / "Applications"
|
||||
apps.mkdir()
|
||||
bundle = apps / "Test.app"
|
||||
bundle.mkdir()
|
||||
(bundle / "Contents").mkdir()
|
||||
n, msg = _count_apps(apps)
|
||||
assert n == 1
|
||||
assert msg == "ok"
|
||||
|
||||
|
||||
def test_count_apps_missing_dir(tmp_path: Path) -> None:
|
||||
n, msg = _count_apps(tmp_path / "nope")
|
||||
assert n == 0
|
||||
assert "not a directory" in msg
|
||||
Reference in New Issue
Block a user