Skip to content

[python] Add ARM operation-templates nextLink paging coverage for mock API tests - #11724

Open
Yuchao Yan (msyyc) with Copilot wants to merge 3 commits into
mainfrom
copilot/add-test-case-for-5214
Open

[python] Add ARM operation-templates nextLink paging coverage for mock API tests#11724
Yuchao Yan (msyyc) with Copilot wants to merge 3 commits into
mainfrom
copilot/add-test-case-for-5214

Conversation

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This updates the Python mock API suite to cover the ARM operation-templates paging scenario introduced in Azure/typespec-azure#5214. The tests now validate that post_action_paging consumes the nextLink page, not just the first page.

  • Spec version alignment

    • Bumped @azure-tools/azure-http-specs in packages/http-client-python to 0.1.0-alpha.45-dev.3 so the new paging contract (@nextLink on MonitoredResourceListResponse.nextLink) is available to the test pipeline.
  • Mock API paging assertions (sync + async)

    • Extended:
      • tests/mock_api/azure/test_azure_arm_operationtemplates.py
      • tests/mock_api/azure/asynctests/test_azure_arm_operationtemplates_async.py
    • test_paging_post_action_paging now asserts two items are returned and validates second-page content (vm2, sending_metrics=False), confirming continuation traversal.
  • Changelog

    • Added an internal Chronus entry for @typespec/http-client-python describing the new nextLink paging coverage.
items = list(result)
assert len(items) == 2
assert items[0].id.endswith("/vm1")
assert items[1].id.endswith("/vm2")
assert items[1].sending_metrics is False

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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 Aug 19, 2026
Copilot AI changed the title [WIP] Add test case for Azure typespec PR 5214 [python] Add ARM operation-templates nextLink paging coverage for mock API tests Aug 19, 2026
@msyyc
Yuchao Yan (msyyc) marked this pull request as ready for review August 21, 2026 08:17
Copilot AI lite review requested due to automatic review settings August 21, 2026 08:17
@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 0b7f773

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the http-client-python mock API tests to validate ARM operation-templates POST action paging properly follows nextLink continuations, matching the updated azure-http-specs paging contract.

Changes:

  • Extend sync and async mock API paging tests to assert a second page is fetched (2 items total) and validate second-page content (vm2, sending_metrics == False).
  • Bump @azure-tools/azure-http-specs to 0.1.0-alpha.45-dev.3 so the updated paging shape (including nextLink) is available.
  • Add a Chronus entry documenting the internal test-coverage update.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/http-client-python/tests/mock_api/azure/test_azure_arm_operationtemplates.py Strengthens sync paging test by asserting second-page traversal and content.
packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_arm_operationtemplates_async.py Strengthens async paging test by asserting second-page traversal and content.
packages/http-client-python/package.json Updates @azure-tools/azure-http-specs version to pick up the nextLink paging contract.
packages/http-client-python/package-lock.json Locks the updated @azure-tools/azure-http-specs tarball/version and metadata.
.chronus/changes/python-spector-tests-arm-operationtemplates-nextlink-2026-8-19-6-0-0.md Adds an internal changelog entry for the added paging coverage.
Files not reviewed (1)
  • packages/http-client-python/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Add sync and async mock API coverage for ARM operation templates POST action paging to validate nextLink pagination across pages.

@github-actions

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:3e5e2a234636367bba93845a7bebdc7b7878b1c4 vs this PR.

Diff summary: 4 file(s), +4 / -4

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

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/Azure/typespec-azure/pull/5214

4 participants