Skip to content

[python] Add mock API tests for AlternateInitialVerb POST pagination scenario#10075

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

[python] Add mock API tests for AlternateInitialVerb POST pagination scenario#10075
Copilot wants to merge 3 commits intomainfrom
copilot/add-test-case-python-sdk

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

Adds Python SDK mock API tests for the Payload_Pageable_ServerDrivenPagination_AlternateInitialVerb_post scenario from #9966 — pagination where the initial request is a POST (with filter body) and subsequent next-link fetches use GET.

Changes

  • package.json: Bump @typespec/http-specs to 0.1.0-alpha.35-dev.4 (first version published after Alternate initial verb #9966 merged that includes the new scenario)
  • test_payload_pageable.py / test_payload_pageable_async.py: Add sync + async tests calling the new alternate_initial_verb.post() operation
def test_alternate_initial_verb_post(client: PageableClient):
    result = list(client.server_driven_pagination.alternate_initial_verb.post(Filter(filter="foo eq bar")))
    assert_result(result)  # expects 4 pets: dog, cat, bird, fish across 2 pages

Tests live in generic_mock_api_tests (shared between azure/unbranded flavors) since both generated clients expose the same payload.pageable import path.

Original prompt

This section details on the original issue you should resolve

<issue_title>[python] add test case for #9966
</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 #9966
</issue_description>

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


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…nario (PR #9966)

- Update @typespec/http-specs to 0.1.0-alpha.35-dev.4 which includes the new scenario
- Add sync test `test_alternate_initial_verb_post` to generic_mock_api_tests/test_payload_pageable.py
- Add async test `test_alternate_initial_verb_post` to generic_mock_api_tests/asynctests/test_payload_pageable_async.py
- Add changelog entry

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 18, 2026
Copilot AI changed the title [WIP] [python] Add test case for pull request 9966 [python] Add mock API tests for AlternateInitialVerb POST pagination scenario Mar 18, 2026
Copilot AI requested a review from msyyc March 18, 2026 23:02
@msyyc msyyc marked this pull request as ready for review March 18, 2026 23:59
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@10075

commit: 69992b4

@github-actions
Copy link
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - internal ✏️

Add mock API test case for the AlternateInitialVerb POST pagination scenario where the initial request uses POST with a filter body and subsequent next link requests use GET.

@msyyc msyyc enabled auto-merge March 19, 2026 01:50
@msyyc
Copy link
Contributor

msyyc commented Mar 19, 2026

move to #10068

@msyyc msyyc closed this Mar 19, 2026
auto-merge was automatically disabled March 19, 2026 01:53

Pull request was closed

@msyyc msyyc deleted the copilot/add-test-case-python-sdk branch March 19, 2026 01:53
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/9966

2 participants