Initial commit
This commit is contained in:
22
tests/test_core_firewall.py
Normal file
22
tests/test_core_firewall.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user