Skip to content

Improve REST API unit-test coverage with request assertions and parameterized quote tests #257

Open

Description

@VEERESH069

Summary

Several REST API unit tests currently verify only response types. They do not verify that the expected request body, query parameters, HTTP method, and URL are sent correctly.

Proposed changes

1. Add request assertions

Update the REST API tests in tests/unit/test_connect.py to assert request details for:

  • historical_data
  • trigger_range
  • convert_position
  • place_mf_order
  • cancel_mf_order
  • place_mf_sip
  • modify_mf_sip
  • cancel_mf_sip

The tests should verify:

  • HTTP method
  • Request URL
  • Request body or query parameters
  • Boolean and optional parameter serialization
  • URL path parameters such as order_id and sip_id

2. Add parameterized quote tests

Add parameterized tests for:

  • quote
  • ohlc
  • ltp

Each test should cover both supported calling styles:

kiteconnect.quote("NSE:INFY", "NSE:RELIANCE")

the legacy list-style form:

kiteconnect.quote(["NSE:INFY", "NSE:RELIANCE"])

**Acceptance criteria**
Request methods, URLs, and parameters are asserted.
Quote tests use pytest.mark.parametrize.
Positional and legacy list-style arguments are covered.
Tests use the existing responses library and mock-response helpers.
No live API credentials or network requests are required.
Existing tests continue to pass.
**The implementation does not change public API behavior.
Related files**
tests/unit/test_connect.py
tests/helpers/utils.py
kiteconnect/connect.py

Activity

  1. Almaryj1 commented on Nov 12, 2026

    @Almaryj1

    Hi @VEERESH069 , I'd like to work on this. I'll add request assertions for the 8 API methods listed and parameterized tests for quote, ohlc, and ltp. Will submit a PR shortly.

  2. Almaryj1 commented on Nov 12, 2026

    @Almaryj1

    @VEERESH069 I've submitted a PR for this: #259

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions