Skip to content

[python] Add test cases for float duration encode in query/header params#9976

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-test-case-python-sdk
Closed

[python] Add test cases for float duration encode in query/header params#9976
Copilot wants to merge 2 commits intomainfrom
copilot/add-test-case-python-sdk

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

PR #9945 fixed the duration encode mock API to use numeric (not string) comparison for float query/header params, so values like 35625.0 correctly match 35625. This PR adds Python test coverage for the 8 scenarios that fix addressed.

Changes

  • package.json: Bump @typespec/http-specs 0.1.0-alpha.33-dev.20.1.0-alpha.33-dev.6 (first version containing the mock API fix)
  • 4 test files (azure + unbranded, sync + async): Extend test_query and test_header with the previously untested float milliseconds/larger-unit scenarios:
# Query — whole-number floats that previously failed string comparison
client.query.float_milliseconds(input=35625.0)
client.query.float64_milliseconds(input=35625.0)
client.query.float_seconds_larger_unit(input=150.0)
client.query.float_milliseconds_larger_unit(input=210000.0)

# Header — same, with duration= kwarg
client.header.float_milliseconds(duration=35625.0)
client.header.float64_milliseconds(duration=35625.0)
client.header.float_seconds_larger_unit(duration=150.0)
client.header.float_milliseconds_larger_unit(duration=210000.0)
Original prompt

This section details on the original issue you should resolve

<issue_title>[python] add test case for #9945
</issue_title>
<issue_description>follow skill https://github.com/microsoft/typespec/blob/main/.github/skills/python-sdk-spector-mock-api-tests/SKILL.md to write test case for #9945
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Mar 10, 2026
Copilot AI changed the title [WIP] Add test case for python SDK mock API [python] Add test cases for float duration encode in query/header params Mar 10, 2026
@msyyc
Copy link
Contributor

msyyc commented Mar 10, 2026

We don't have plan to support the feature for now.

@msyyc msyyc closed this Mar 10, 2026
@msyyc msyyc deleted the copilot/add-test-case-python-sdk branch March 10, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[python] add test case for https://github.com/microsoft/typespec/pull/9945

2 participants