Files
applepy/tests/test_core_firewall.py
Warezpeddler 3325436017 Initial commit
2026-04-25 23:09:31 +01:00

23 lines
639 B
Python

from applepy.checks.core import _parse_alf_globalstate
def test_parse_alf_globalstate_digit() -> None:
state, note = _parse_alf_globalstate("0\n", 0)
assert state == 0
assert note == "ok"
def test_parse_alf_globalstate_multiline() -> None:
state, note = _parse_alf_globalstate("foo\n2\n", 0)
assert state == 2
assert note == "ok"
def test_parse_alf_globalstate_missing() -> None:
state, note = _parse_alf_globalstate(
"2025-01-01 12:00:00.000 defaults[123:456] Could not find domain com.apple.alf\n",
1,
)
assert state is None
assert note == "preference_missing_or_unreadable"