Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down