Initial commit
This commit is contained in:
22
tests/test_extended_surface.py
Normal file
22
tests/test_extended_surface.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Tests for extended_surface checks (cross-platform where possible)."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from applepy.checks.extended_surface import check_hosts_file, check_shell_startup_files
|
||||
from applepy.context import RunContext
|
||||
|
||||
|
||||
def test_check_hosts_file_returns_finding(tmp_path: Path) -> None:
|
||||
ctx = RunContext(home=tmp_path, output_dir=tmp_path, phase="unprivileged")
|
||||
out = check_hosts_file(ctx)
|
||||
assert len(out) == 1
|
||||
assert out[0].id == "ext-102"
|
||||
assert out[0].worksheet == "Attack surface"
|
||||
|
||||
|
||||
def test_check_shell_startup_lists_paths(tmp_path: Path) -> None:
|
||||
ctx = RunContext(home=tmp_path, output_dir=tmp_path, phase="unprivileged")
|
||||
out = check_shell_startup_files(ctx)
|
||||
assert len(out) == 1
|
||||
assert out[0].id == "ext-107"
|
||||
assert ".zshrc" in out[0].evidence or "zshrc" in out[0].evidence
|
||||
Reference in New Issue
Block a user