Repository navigation
test(python): add response replacement mock API coverage - #12010
Yuchao Yan (msyyc) with Copilot wants to merge 7 commits into
Conversation
|
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>
|
Copilot resolve the merge conflicts in this pull request |
1 similar comment
|
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>
Resolved the merge conflict and pushed merge commit |
The branch already contains the current |
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
commit: |
|
All changed packages have been documented.
Show changes
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The tests assert fallback model deserialization instead of the response-replacement behavior defined by the linked Spector scenario.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds Python mock API coverage for Azure response-replacement scenarios.
Changes:
- Updates Azure HTTP specs and regeneration configuration.
- Adds synchronous and asynchronous tests.
- Adds an internal changelog entry.
| File | Description |
|---|---|
test_azure_client_generator_core_response_replacement.py |
Adds sync response tests. |
asynctests/test_azure_client_generator_core_response_replacement_async.py |
Adds async response tests. |
package.json |
Updates the Spector dependency. |
package-lock.json |
Locks the updated dependency. |
regenerate-common.ts |
Registers generation options for the scenario. |
.chronus/changes/python-response-replacement-mock-api-tests-2026-9-18-2-0-7.md |
Records the internal change. |
Files not reviewed (1)
- packages/http-client-python/package-lock.json: Generated file
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @pytest.mark.asyncio | ||
| async def test_void_response(client: ResponseReplacementClient): | ||
| assert await client.void_response() == Widget(name="widget") | ||
|
|
||
|
|
| def test_void_response(client: ResponseReplacementClient): | ||
| assert client.void_response() == Widget(name="widget") | ||
|
|
||
|
|
||
| def test_bytes_response(client: ResponseReplacementClient): |
Python emitter diffBaseline
Informational check (eng/emitter-diff); does not block the PR. |
Pull request was converted to draft
|
Copilot resolve the merge conflicts in this pull request |
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Resolved the conflicts and merged latest |

Adds Python mock API coverage for Azure Spector response-replacement scenarios introduced in Azure/typespec-azure#5471.
Changes
Spector dependency
@azure-tools/azure-http-specsto0.1.0-alpha.46-dev.2.Mock API coverage
void_responseandbytes_response.@typespec/http-client-pythonchange entry.