23 lines
639 B
Python
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"
|