Harden fetcher + add live smoke tests

- Exponential backoff: retry waits are now 1s, 2s, 4s (was linear 1s, 2s, 3s)
- Cache poisoning prevention: validate Content-Type is not HTML before JSON parse,
  reject non-dict/list responses before caching
- Add 18 live smoke tests against real public APIs (USGS, CoinGecko, Yahoo Finance,
  SEC EDGAR, FAA, NOAA SWPC, Hacker News, NASA EONET, etc.)
- Smoke tests excluded from default pytest run; opt-in with: pytest -m smoke
- All 220 unit tests + 18 smoke tests pass
This commit is contained in:
Marc Shade
2026-04-06 18:53:03 -04:00
parent 29ebccf80b
commit bfe89f4f7a
3 changed files with 269 additions and 3 deletions
+4 -1
View File
@@ -47,4 +47,7 @@ packages = ["src/world_intel_mcp"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["src/world_intel_mcp/tests"]
addopts = "-v --tb=short"
addopts = "-v --tb=short -m 'not smoke'"
markers = [
"smoke: live API tests (deselected by default, run with: pytest -m smoke)",
]