Skip to content

[python] Add mock_api coverage for namespace-scoped @usage scenario#10807

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-test-case-for-pull-4493
Draft

[python] Add mock_api coverage for namespace-scoped @usage scenario#10807
Copilot wants to merge 3 commits into
mainfrom
copilot/add-test-case-for-pull-4493

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

This PR adds Python SDK mock API coverage for the new Azure Spector scenario introduced in Azure/typespec-azure PR #4493, where @usage is applied at a namespace level and propagates to nested types.
It ensures the generated usage client surface is exercised for the new namespaceModelSerializable operation in both sync and async test suites.

  • Scenario alignment (Azure Spector update)

    • Updated @azure-tools/azure-http-specs in packages/http-client-python to a version containing Azure_ClientGenerator_Core_Usage_NamespaceUsage.
  • Azure mock_api test coverage (sync + async)

    • Extended existing usage tests:
      • tests/mock_api/azure/test_azure_client_generator_core_usage.py
      • tests/mock_api/azure/asynctests/test_azure_client_generator_core_usage_async.py
    • Added test_namespace_model_serializable in both files to validate SDK invocation of the new namespace-usage route.
  • Change log

    • Added Chronus entry for @typespec/http-client-python documenting the test coverage addition.
def test_namespace_model_serializable(client: UsageClient):
    namespace_model = models.NamespaceModel(name="test")
    client.namespace_usage.namespace_model_serializable(body=namespace_model)

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 May 26, 2026
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test case for Azure typespec pull request 4493 [python] Add mock_api coverage for namespace-scoped @usage scenario May 26, 2026
Copilot finished work on behalf of msyyc May 26, 2026 23:28
Copilot AI requested a review from msyyc May 26, 2026 23:28
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/4493

2 participants