Skip to content

test: add unit tests for market data, MF orders, and SIP operations - #255

Open
deolreet21 wants to merge 1 commit into
zerodha:masterfrom
deolreet21:add-missing-tests
Open

deolreet21 wants to merge 1 commit into
zerodha:masterfrom
deolreet21:add-missing-tests

Conversation

@deolreet21

Copy link
Copy Markdown

Closes #254

Summary

  • Adds 11 tests to tests/unit/test_connect.py covering quote, ohlc, ltp, historical_data, trigger_range, convert_position, place_mf_order, cancel_mf_order, place_mf_sip, modify_mf_sip, cancel_mf_sip
  • Adds 6 missing mock response path mappings to tests/helpers/utils.py for routes that had no entry despite the JSON files existing in the kiteconnect-mocks submodule

Why test_connect.py and not a new file

The repo has one test file per concern:

  • test_connect.py — all REST API methods on KiteConnect
  • test_exceptions.py — exception class behaviour
  • test_kite_object.py — object construction and configuration
  • test_ticker.py — KiteTicker WebSocket client

All 11 new tests cover REST API methods on the KiteConnect HTTP client — the same class test_connect.py already tests. Creating a separate file would split tests for the same class across two files with no principled distinction, so the tests are appended to the existing file.

Test run

59 passed, 4 warnings in 0.29s

Adds 11 tests covering quote, OHLC, LTP, historical data, trigger range,
position conversion, MF order/cancel, and MF SIP place/modify/cancel.
Also adds missing mock response path mappings in utils.py.
@deolreet21

Copy link
Copy Markdown
Author

Hi @ranjanrak, could you please approve the CI workflows for this PR? This adds 11 missing unit tests for market data, MF order, and SIP methods, along with missing mock response path mappings in utils.py. Happy to address any feedback. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing unit tests for market data, MF orders, and SIP operations

1 participant