Skip to content

[python] Add mock_api coverage for single-discriminator no-subtypes scenario#10896

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-test-case-python-sdk-spector
Draft

[python] Add mock_api coverage for single-discriminator no-subtypes scenario#10896
Copilot wants to merge 2 commits into
mainfrom
copilot/add-test-case-python-sdk-spector

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

This adds python mock API coverage for the new Spector scenario introduced by the cross-language spec updates: a discriminated model with no declared subtypes. The PR extends existing single-discriminator tests in both sync and async suites and aligns local spec inputs to a version that contains the scenario.

  • Test coverage: single-discriminator no-subtypes (shared sync/async)

    • Extended existing shared tests to cover:
      • get_no_subtypes_model()
      • put_no_subtypes_model(...)
    • Added Fish model assertions to validate the expected wire payload shape (kind, size).
  • Spec dependency update for scenario availability

    • Updated @typespec/http-specs in packages/http-client-python/package.json (and lockfile) to a version containing the new scenario definitions used by regeneration.
  • Change tracking

    • Added a Chronus internal entry for @typespec/http-client-python.
def test_get_no_subtypes_model(client):
    assert client.get_no_subtypes_model() == Fish(kind="salmon", size=10)

def test_put_no_subtypes_model(client):
    client.put_no_subtypes_model(Fish(kind="salmon", size=10))

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 Jun 4, 2026
Copilot AI changed the title [WIP] Add test case for Python SDK Spector mock API [python] Add mock_api coverage for single-discriminator no-subtypes scenario Jun 4, 2026
Copilot finished work on behalf of msyyc June 4, 2026 23:30
Copilot AI requested a review from msyyc June 4, 2026 23:30
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/10841

2 participants