21 lines
505 B
Python
21 lines
505 B
Python
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
|