Skip to content

[python] Add mock API tests for Azure/typespec-azure PR #4959 Spector scenarios - #11410

Draft
msyyc with Copilot wants to merge 3 commits into
mainfrom
copilot/add-test-case-for-4959
Draft

[python] Add mock API tests for Azure/typespec-azure PR #4959 Spector scenarios#11410
msyyc with Copilot wants to merge 3 commits into
mainfrom
copilot/add-test-case-for-4959

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds Python SDK mock API tests for new Spector scenarios introduced in Azure/typespec-azure#4959. Bumps @azure-tools/azure-http-specs to 0.1.0-alpha.44-dev.5 to include the unreleased specs.

New test coverage

azure/resource-manager/operation-templates — 7 sync + 7 async tests added to existing files:

  • LRO.getLro — GET with @markAsLro
  • LROPaging.postPagingLroWithBody — POST LRO returning paged results
  • Legacy.routedGet — GET via Legacy.RoutedOperations with custom route
  • Legacy.createOrReplaceOptionalBody — PUT with optional body (both empty and populated)
  • Paging.postActionPaging — POST returning ItemPaged results
  • Paging.markAsPageable — GET list via @markAsPageable

azure/client-generator-core/api-version/client-api-versions — new sync + async test files:

  • Validates @clientApiVersions allows sending an older API version not in the service versions list
# Client constructed with api_version="2022-10-01" even though service only advertises "2024-01-01"
with ClientApiVersionsClient(endpoint="http://localhost:3000", api_version="2022-10-01") as client:
    client.send_api_version()  # succeeds

Note: azure/resource-manager/service-group and related arm-resource-identifier specs from the same PR are not testable yet — they require Extension.ServiceGroup support in @azure-tools/typespec-azure-resource-manager which is not yet available in the current workspace.

@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.

…Spector specs

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 Jul 27, 2026
…ientApiVersions

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test case for pull request 4959 [python] Add mock API tests for Azure/typespec-azure PR #4959 Spector scenarios Jul 27, 2026
Copilot finished work on behalf of msyyc July 27, 2026 09:22
Copilot AI requested a review from msyyc July 27, 2026 09:22
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/4959

2 participants