Commit Graph

4 Commits

Author SHA1 Message Date
6f571b9e12 test(sveta): Write tests for the web API
Outcome: done
Changed: tests/test_api.py:1-96
Verified by: `make verify` — passed (compileall src/tests/app, 31 unittest tests OK)
Findings: tests/test_api.py:1-96 written — 15 tests covering all 4 endpoints (add, subtract, clamp, clamp_to_byte) with success cases, missing-param failures, invalid-type failures, and boundary conditions (clamp low>high, clamp_to_byte above 255). All use Flask test client. make verify passes with 31 tests total.
Open: none
Confidence: high — all acceptance criteria met; each endpoint has ≥1 success test and ≥1 failure test; Flask test client used without a running server; tests follow the `# retoor` header convention in tests/; `make verify` confirmed passing.

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: 045e88c491a9472ea4d6e41b0ebb7d45
Typosaurus-Agent: @sveta
Refs: #9
2026-07-26 16:09:04 +02:00
8605a8c596 test(sveta): Write clamp tests
Outcome: done
Changed: tests/__init__.py:1, tests/test_calculator.py:1-86
Verified by: `make verify` — exit 0, "verification passed", Ran 16 tests in 0.001s, OK
Findings: tests/ directory created at ./tests/ with __init__.py (header only) and test_calculator.py (16 tests for clamp).
Findings: All 16 clamp tests pass under `make verify`: value below low, above high, in range, equals low, equals high, low>high ValueError, negative values, float below/above/in-range/equals-boundary, float low>high ValueError, large values, -inf/inf boundaries, and NaN.
Findings: clamp is typed as (value: int, low: int, high: int) -> int; float and inf/NaN tests pass because Python does not enforce type hints at runtime.
Open: none
Confidence: high - all 16 tests pass, all acceptance criteria covered, make verify passes

Typosaurus-Run: 5b5c36bf38254bf4bfcdbde317991a5a
Typosaurus-Node: 56f03705c3d64023ba102d3aa3169ef2
Typosaurus-Agent: @sveta
Refs: #7
2026-07-25 19:04:03 +02:00
f5363514bf chore: reset calculator to a clean baseline 2026-07-25 18:58:10 +02:00
8f7f09f44a test(sveta): Write tests for multiply and divide
Outcome: done
Changed: tests/test_calculator.py:1-65, Makefile:1
Verified by: `make verify` — exit 0, "Ran 16 tests in 0.000s ... OK"
Findings: tests/test_calculator.py exists with 16 test methods covering add, subtract, multiply (positive/negative/zero), divide (positive/negative/zero-numerator/floor), and divide-by-zero ValueError.
           make verify now runs both compileall (src + tests) and unittest discover, all passing.
Open: none
Confidence: high — all 16 tests pass; coverage spans all acceptance criteria including multiply edge cases (positive, negative, zero) and divide edge cases (positive, negative, zero numerator, divide-by-zero).

Typosaurus-Run: d9404e45783a42b586e07fc0342eee5c
Typosaurus-Node: 00f8d57fc2964dc9bf5ae68ad25a6e18
Typosaurus-Agent: @sveta
Refs: #2
2026-07-25 17:08:53 +02:00