From 5f2c428d1cbe8fd814a887bf5286c4912af3c71e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Sep 2026 05:22:12 +0000 Subject: [PATCH 1/2] Initial plan From edc54f38308811548aa52f1ea85ae5269c8b5423 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Sep 2026 05:26:12 +0000 Subject: [PATCH 2/2] test(python): assert alternate types deserialize to GeoJSON Features Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .../changes/python-alternate-type-test-2026-9-29-5-24-0.md | 7 +++++++ ...est_azure_client_generator_core_alternate_type_async.py | 2 ++ .../test_azure_client_generator_core_alternate_type.py | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 .chronus/changes/python-alternate-type-test-2026-9-29-5-24-0.md diff --git a/.chronus/changes/python-alternate-type-test-2026-9-29-5-24-0.md b/.chronus/changes/python-alternate-type-test-2026-9-29-5-24-0.md new file mode 100644 index 00000000000..0a37fb768e2 --- /dev/null +++ b/.chronus/changes/python-alternate-type-test-2026-9-29-5-24-0.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-python" +--- + +Assert alternate-type responses are deserialized as `geojson.Feature` in sync and async mock API tests. diff --git a/packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_client_generator_core_alternate_type_async.py b/packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_client_generator_core_alternate_type_async.py index 30f453723e1..31f286792b5 100644 --- a/packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_client_generator_core_alternate_type_async.py +++ b/packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_client_generator_core_alternate_type_async.py @@ -34,6 +34,7 @@ async def test_external_type_get_model(client: AlternateTypeClient): """Test getting a Feature object with geometry, properties, and optional id fields.""" result = await client.external_type.get_model() + assert isinstance(result, geojson.Feature) # Validate the response structure based on the TypeSpec example assert result.type == "Feature" assert result.geometry.type == "Point" @@ -55,6 +56,7 @@ async def test_external_type_get_property(client: AlternateTypeClient): """Test getting a ModelWithFeatureProperty object with feature and additionalProperty fields.""" result = await client.external_type.get_property() + assert isinstance(result.feature, geojson.Feature) # Validate the response structure based on the TypeSpec example assert result.feature.type == "Feature" assert result.feature.geometry.type == "Point" diff --git a/packages/http-client-python/tests/mock_api/azure/test_azure_client_generator_core_alternate_type.py b/packages/http-client-python/tests/mock_api/azure/test_azure_client_generator_core_alternate_type.py index c5ae3266c87..278333d1ceb 100644 --- a/packages/http-client-python/tests/mock_api/azure/test_azure_client_generator_core_alternate_type.py +++ b/packages/http-client-python/tests/mock_api/azure/test_azure_client_generator_core_alternate_type.py @@ -32,6 +32,7 @@ def test_external_type_get_model(client: AlternateTypeClient): """Test getting a Feature object with geometry, properties, and optional id fields.""" result = client.external_type.get_model() + assert isinstance(result, geojson.Feature) # Validate the response structure based on the TypeSpec example assert result.type == "Feature" assert result.geometry.type == "Point" @@ -51,6 +52,7 @@ def test_external_type_get_property(client: AlternateTypeClient): """Test getting a ModelWithFeatureProperty object with feature and additionalProperty fields.""" result = client.external_type.get_property() + assert isinstance(result.feature, geojson.Feature) # Validate the response structure based on the TypeSpec example assert result.feature.type == "Feature" assert result.feature.geometry.type == "Point"