Spaces:
Running
Running
Commit History
-
Add pytest harness with characterization tests for scrap/ops/serp/utils
ClaudeUnverified signatureAdds a test safety net ahead of any refactoring, per the TDD/architecture review of this codebase (no test infrastructure existed before this): - pytest + pytest-asyncio + respx as dev-only deps (requirements-dev.txt) - Pure-function tests for SerpQuery's n_results clamping, utils.py's exception logging, and every OPS JSON-walking helper (ops.py handles OPS's XML-to-JSON quirk where a repeated element is a list but a single one stays a bare dict - tests cover both shapes for each helper) - HTTP-mocked (respx) tests for scrap_patent_async's HTML parsing (abstract/description/claims/classification-code extraction, plus the documented ValueError path for an unexpected page layout), the OPS token manager's caching/refresh/retry-on-stale-token behavior, and query_arxiv's Atom feed parsing - A DDGS-mocked test pinning the DuckDuckGo empty-results-means-blocked fix from d341a7a, so a regression there fails a test instead of shipping silently - Real-headless-Chromium tests f…5796881