Skip to content

test(python): add response replacement mock API coverage - #12010

Draft
Yuchao Yan (msyyc) with Copilot wants to merge 4 commits into
mainfrom
copilot/add-test-case-for-5471
Draft

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

Conversation

Copilot AI commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Adds Python mock API coverage for Azure Spector response-replacement scenarios introduced in Azure/typespec-azure#5471.

Changes

  • Spector dependency

    • Updates @azure-tools/azure-http-specs to 0.1.0-alpha.46-dev.2.
  • Mock API coverage

    • Adds synchronous and asynchronous tests for void_response and bytes_response.
    • Verifies both operations deserialize the wire response:
assert client.void_response() == Widget(name="widget")
assert client.bytes_response() == Widget(name="widget")
  • Changelog
    • Adds an internal @typespec/http-client-python change entry.

@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 Sep 18, 2026
Copilot AI changed the title [WIP] Add test case for Azure typespec pull request 5471 test(python): add response replacement mock API coverage Sep 18, 2026
@msyyc

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

1 similar comment
@msyyc

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

…-for-5471

# Conflicts:
#	packages/http-client-python/package.json

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

Copilot AI commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

Resolved the merge conflict and pushed merge commit 2dce6e2c.

Copilot AI commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

The branch already contains the current main merge (2dce6e2c); no conflicts remain to resolve.



@pytest_asyncio.fixture
async def client():

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.

Copilot add "namespace" configuration in https://github.com/microsoft/typespec/blob/main/packages/http-client-python/eng/scripts/ci/regenerate-common.ts to keep consistent with other similar test cases then update test files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the response-replacement namespace override and updated both test imports in d910354c.

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

This branch has not been deployed

No deployments
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/5471

2 participants