Skip to content

[python] Add payload/xml mock API coverage for PR #10558 union formatting scenario#10645

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

[python] Add payload/xml mock API coverage for PR #10558 union formatting scenario#10645
Copilot wants to merge 2 commits into
mainfrom
copilot/add-test-case-for-pull-10558

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

PR #10558 changed payload/xml scenario shape formatting (XmlErrorValue.get() union layout). This updates python mock API coverage to explicitly validate behavior for that scenario path in both sync and async clients.

  • Spec alignment

    • Bump @typespec/http-specs to a version containing the updated payload/xml Spector case (0.1.0-alpha.37-dev.6).
  • Mock API test coverage (shared sync + async)

    • Extend existing shared tests:
      • tests/mock_api/shared/test_payload_xml.py
      • tests/mock_api/shared/asynctests/test_payload_xml_async.py
    • Add focused assertions for xml_error_value.get() error response content type to ensure XML response handling remains stable with the updated union scenario shape.
  • Changelog

    • Add .chronus/changes/* entry for @typespec/http-client-python (changeKind: internal).
with pytest.raises(core_library.exceptions.HttpResponseError) as ex:
    client.xml_error_value.get()

assert ex.value.response.headers["content-type"].startswith("application/xml")

@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 11, 2026
Copilot AI changed the title [WIP] Add test case for pull request 10558 [python] Add payload/xml mock API coverage for PR #10558 union formatting scenario May 11, 2026
Copilot finished work on behalf of msyyc May 11, 2026 23:14
Copilot AI requested a review from msyyc May 11, 2026 23:14
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/microsoft/typespec/pull/10558

2 participants