feat: multi-test case view
This commit is contained in:
parent
6477fdc20c
commit
aab211902e
12 changed files with 315 additions and 124 deletions
|
|
@ -10,6 +10,7 @@ import httpx
|
|||
|
||||
from .base import BaseScraper
|
||||
from .models import (
|
||||
CombinedTest,
|
||||
ContestListResult,
|
||||
ContestSummary,
|
||||
MetadataResult,
|
||||
|
|
@ -233,8 +234,16 @@ class CSESScraper(BaseScraper):
|
|||
except Exception:
|
||||
tests = []
|
||||
timeout_ms, memory_mb, interactive = 0, 0, False
|
||||
|
||||
combined_input = "\n".join(t.input for t in tests)
|
||||
combined_expected = "\n".join(t.expected for t in tests)
|
||||
|
||||
return {
|
||||
"problem_id": pid,
|
||||
"combined": {
|
||||
"input": combined_input,
|
||||
"expected": combined_expected,
|
||||
},
|
||||
"tests": [
|
||||
{"input": t.input, "expected": t.expected} for t in tests
|
||||
],
|
||||
|
|
@ -282,6 +291,7 @@ async def main_async() -> int:
|
|||
success=False,
|
||||
error="Usage: cses.py tests <category>",
|
||||
problem_id="",
|
||||
combined=CombinedTest(input="", expected=""),
|
||||
tests=[],
|
||||
timeout_ms=0,
|
||||
memory_mb=0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue