Skip to content

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

Merged
Yuchao Yan (msyyc) merged 4 commits into
mainfrom
copilot/add-test-case-for-5214
Sep 2, 2026
Merged

[python] Add ARM operation-templates nextLink paging coverage for mock API tests#11724
Yuchao Yan (msyyc) merged 4 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: babc026

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

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:3e0ad3379c45abe0d65648353f600a6427e4ab1e 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

Copilot AI review requested due to automatic review settings August 25, 2026 09:08

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

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

Files not reviewed (1)
  • packages/http-client-python/package-lock.json: Generated file

@msyyc
Yuchao Yan (msyyc) added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 536de8b Sep 2, 2026
37 of 38 checks passed
@msyyc
Yuchao Yan (msyyc) deleted the copilot/add-test-case-for-5214 branch September 2, 2026 11:11
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