What
Build out a broader local-only test suite that exercises the SDK without hitting the live API. Use responses-mocked HTTP (as in tests/util.py / test_call.py / test_query_params.py) so the suite runs offline with no API key.
Why
Current coverage splits awkwardly:
tests/test_integration.py (~1060 lines) is comprehensive but requires DATAMAXI_API_KEY + real network — skipped in normal local/CI runs.
- The mocked local tests only reach
api, error, liquidation, open_interest. Most modules have no local coverage: cex, cex_announcement, cex_candle, cex_fee, cex_symbol, cex_ticker, cex_token, cex_wallet_status, forex, funding_rate, premium, plus naver and telegram.
So a regression in those modules passes CI silently unless someone runs the keyed integration tests.
Scope (this issue: local only)
- Add mocked unit tests covering each
datamaxi/datamaxi/*.py module + naver + telegram: happy-path response shape, query-param construction, and error handling (ClientError/ServerError).
- Reuse
tests/util.mock_http_response; no real network, no API key required.
- Leave
test_integration.py as-is (keyed, network). A later issue can wire it into CI with secrets.
Done when
- New mocked tests cover every SDK module listed above.
python -m pytest tests/ -k "not integration" (or equivalent) passes offline with no DATAMAXI_API_KEY set.
pytest --cov=datamaxi shows a meaningful coverage bump over current local-only runs.
Related: #83
What
Build out a broader local-only test suite that exercises the SDK without hitting the live API. Use
responses-mocked HTTP (as intests/util.py/test_call.py/test_query_params.py) so the suite runs offline with no API key.Why
Current coverage splits awkwardly:
tests/test_integration.py(~1060 lines) is comprehensive but requiresDATAMAXI_API_KEY+ real network — skipped in normal local/CI runs.api,error,liquidation,open_interest. Most modules have no local coverage:cex,cex_announcement,cex_candle,cex_fee,cex_symbol,cex_ticker,cex_token,cex_wallet_status,forex,funding_rate,premium, plusnaverandtelegram.So a regression in those modules passes CI silently unless someone runs the keyed integration tests.
Scope (this issue: local only)
datamaxi/datamaxi/*.pymodule +naver+telegram: happy-path response shape, query-param construction, and error handling (ClientError/ServerError).tests/util.mock_http_response; no real network, no API key required.test_integration.pyas-is (keyed, network). A later issue can wire it into CI with secrets.Done when
python -m pytest tests/ -k "not integration"(or equivalent) passes offline with noDATAMAXI_API_KEYset.pytest --cov=datamaxishows a meaningful coverage bump over current local-only runs.Related: #83