test: add full test suite with 100% coverage across all modules
All checks were successful
CI / Lint (push) Successful in 6s
CI / Test (push) Successful in 7s
CI / Build & Push (push) Successful in 15s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 13:17:20 -04:00
parent dd5ac945bd
commit def491a4d4
6 changed files with 516 additions and 0 deletions

View File

@@ -42,3 +42,23 @@ class TestScoreboardRoute:
response = flask_client.get("/scoreboard")
data = json.loads(response.data)
assert "error" in data
def test_invalid_json_returns_error(self, flask_client, monkeypatch, tmp_path):
import app.routes as routes
bad_file = tmp_path / "bad.json"
bad_file.write_text("not valid json {{{")
monkeypatch.setattr(routes, "SCOREBOARD_DATA_FILE", str(bad_file))
response = flask_client.get("/scoreboard")
data = json.loads(response.data)
assert "error" in data
def test_null_json_returns_error(self, flask_client, monkeypatch, tmp_path):
import app.routes as routes
null_file = tmp_path / "null.json"
null_file.write_text("null")
monkeypatch.setattr(routes, "SCOREBOARD_DATA_FILE", str(null_file))
response = flask_client.get("/scoreboard")
data = json.loads(response.data)
assert "error" in data