Compare commits

..

No commits in common. "43a28045627ace667c7988adde0a123abee4536d" and "240d962ec3f3a29d0b46b258fa93e78e23f36af6" have entirely different histories.

2 changed files with 0 additions and 23 deletions

View File

@ -79,8 +79,6 @@ async def context() -> JSONResponse:
)
if not isinstance(user_data, dict):
raise ValueError("Gitea current-user response was not an object")
if not all(field in user_data for field in ("id", "login")):
raise ValueError("Gitea current-user response did not include id and login")
except Exception as e:
error_message = (
f"Gitea context request timed out after {CONTEXT_TIMEOUT_SECONDS:g}s"

View File

@ -250,27 +250,6 @@ async def test_context_returns_fallback_for_null_current_user_payload(monkeypatc
assert context["error"] == "Gitea current-user response was not an object"
@pytest.mark.anyio
async def test_context_returns_fallback_for_incomplete_current_user_payload(monkeypatch):
async def incomplete_user():
return {"id": 1}
async def empty_collection():
return []
monkeypatch.setattr(main, "current_user", incomplete_user)
monkeypatch.setattr(main, "repos", empty_collection)
monkeypatch.setattr(main, "issues", empty_collection)
monkeypatch.setattr(main, "pull_requests", empty_collection)
response = await main.context()
context = json.loads(response.body)
assert response.status_code == 200
assert context["repos"] == []
assert context["error"] == "Gitea current-user response did not include id and login"
@pytest.mark.anyio
async def test_context_skips_malformed_repository_entries(monkeypatch):
async def user():