fix: normalize nested activity metadata (#95)
CI / lint (pull_request) Successful in 8s
CI / build-frontend (pull_request) Successful in 4s

This commit is contained in:
timmy committed 2026-08-06 10:16:51 +00:00
1 parent 8f3bbde733
commit 1b43116fe6
2 files changed
+44 -4

No files matched your search

+24
View File
@@ -162,3 +162,27 @@ async def test_activity_events_normalizes_null_feed_payload(monkeypatch):
monkeypatch.setattr(gitea_proxy, "fetch", fake_fetch)
assert await gitea_proxy.activity_events() == []
@pytest.mark.anyio
async def test_activity_events_normalizes_malformed_nested_metadata(monkeypatch):
async def fake_current_user():
return {"login": "timmy"}
async def fake_fetch(path):
return [{
"op_type": None,
"act_user": "unknown",
"repo": None,
"created": None,
}]
monkeypatch.setattr(gitea_proxy, "current_user", fake_current_user)
monkeypatch.setattr(gitea_proxy, "fetch", fake_fetch)
assert await gitea_proxy.activity_events() == [{
"type": "activity",
"actor": {},
"repo": {},
"created_at": "",
}]