mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-07-01 03:04:52 +02:00
fix: preflight member records before rules
This commit is contained in:
@@ -108,6 +108,19 @@ def test_repository_reports_empty_contributions_file(tmp_path) -> None:
|
||||
assert any("contributions.json" in error for error in repository.validate())
|
||||
|
||||
|
||||
def test_repository_rejects_structurally_invalid_member_json(tmp_path) -> None:
|
||||
repository = MemberRepository(tmp_path)
|
||||
repository.initialize()
|
||||
member = repository.create_member(first_name="Invalid", last_name="Structure")
|
||||
path = repository.members_root / member.member_id / "member.json"
|
||||
raw = json.loads(path.read_text(encoding="utf-8"))
|
||||
raw["person"] = []
|
||||
path.write_text(json.dumps(raw), encoding="utf-8")
|
||||
|
||||
with pytest.raises(RepositoryError, match="person muss ein JSON-Objekt sein"):
|
||||
repository.preflight_member_record(member.member_id)
|
||||
|
||||
|
||||
def test_member_path_rejects_traversal(tmp_path) -> None:
|
||||
repository = MemberRepository(tmp_path)
|
||||
repository.initialize()
|
||||
|
||||
Reference in New Issue
Block a user