test: add offline fixture coverage for Kattis and USACO
Problem: Kattis and USACO had zero offline test coverage — no fixtures, no conftest routers, and no entries in the test matrix. Precision, error cases, and the Kattis contest-vs-slug fallback were also untested. Solution: Add HTML fixtures for both platforms covering metadata, tests, and contest list modes. Wire up conftest routers that patch `httpx.AsyncClient.get` using the same pattern as CSES/CodeChef. Extend the test matrix to include Kattis and USACO (18 parametrized cases, up from 12). Add a dedicated test for the Kattis contest-path (verifies `contest_url`/`standings_url` are set). Add parametrized metadata error tests for CSES, USACO, and Kattis. Assert `precision` field type in all tests-mode payloads; `usaco/problem_1471.html` includes an absolute-error hint to exercise `extract_precision`.
This commit is contained in:
parent
9727dccc6f
commit
37ad92432e
12 changed files with 207 additions and 1 deletions
3
tests/fixtures/usaco/contests.html
vendored
Normal file
3
tests/fixtures/usaco/contests.html
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<html><body>
|
||||
<a href="index.php?page=dec24results">December 2024 Results</a>
|
||||
</body></html>
|
||||
14
tests/fixtures/usaco/dec24results.html
vendored
Normal file
14
tests/fixtures/usaco/dec24results.html
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<html><body>
|
||||
|
||||
<h2>USACO 2024 December Contest, Gold</h2>
|
||||
|
||||
<b>Farmer John's Favorite Problem</b><br/>
|
||||
<a href="index.php?page=viewproblem2&cpid=1469">View Problem</a>
|
||||
|
||||
<b>Binary Indexed Tree</b><br/>
|
||||
<a href="index.php?page=viewproblem2&cpid=1470">View Problem</a>
|
||||
|
||||
<b>Counting Subsequences</b><br/>
|
||||
<a href="index.php?page=viewproblem2&cpid=1471">View Problem</a>
|
||||
|
||||
</body></html>
|
||||
10
tests/fixtures/usaco/problem_1469.html
vendored
Normal file
10
tests/fixtures/usaco/problem_1469.html
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<html><body>
|
||||
<p>Time limit: 4s. Memory limit: 256 MB.</p>
|
||||
<p>Given N cows, find the answer.</p>
|
||||
<pre class="in">3
|
||||
1 2 3</pre>
|
||||
<pre class="out">6</pre>
|
||||
<pre class="in">1
|
||||
5</pre>
|
||||
<pre class="out">5</pre>
|
||||
</body></html>
|
||||
7
tests/fixtures/usaco/problem_1470.html
vendored
Normal file
7
tests/fixtures/usaco/problem_1470.html
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<html><body>
|
||||
<p>Time limit: 2s. Memory limit: 512 MB.</p>
|
||||
<p>Build a binary indexed tree.</p>
|
||||
<pre class="in">4
|
||||
1 3 2 4</pre>
|
||||
<pre class="out">10</pre>
|
||||
</body></html>
|
||||
7
tests/fixtures/usaco/problem_1471.html
vendored
Normal file
7
tests/fixtures/usaco/problem_1471.html
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<html><body>
|
||||
<p>Time limit: 4s. Memory limit: 256 MB.</p>
|
||||
<p>Output the answer with absolute error at most 10^{-6}.</p>
|
||||
<pre class="in">2
|
||||
1 2</pre>
|
||||
<pre class="out">1.500000</pre>
|
||||
</body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue