test(codechef): add fixture for /api/list/contests/past endpoint

This commit is contained in:
Barrett Ruth 2026-03-06 23:03:05 -05:00
parent 3b3da9ab9b
commit 4b6b51b8df
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 19 additions and 0 deletions

View file

@ -221,6 +221,9 @@ def run_scraper_offline(fixture_text):
if "/api/list/contests/all" in url:
data = json.loads(fixture_text("codechef/contests.json"))
return MockResponse(data)
if "/api/list/contests/past" in url:
data = json.loads(fixture_text("codechef/contests_past.json"))
return MockResponse(data)
if "/api/contests/START" in url and "/problems/" not in url:
contest_id = url.rstrip("/").split("/")[-1]
try:

View file

@ -0,0 +1,16 @@
{
"status": "success",
"message": "past contests list",
"contests": [
{
"contest_code": "START209D",
"contest_name": "Starters 209 Div 4",
"contest_start_date_iso": "2025-01-01T10:30:00+05:30"
},
{
"contest_code": "START208",
"contest_name": "Starters 208",
"contest_start_date_iso": "2024-12-25T10:30:00+05:30"
}
]
}