Skip to content

Commit 0fe9331

Browse files
Copilotmsyyc
andauthored
[typespec-python] Add test cases for orphan model serialization (#3123)
* Initial plan * Add test cases: uncomment orphan model serializable tests Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Add changelog entry for orphan model serialization test cases Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Change changeKind from feature to internal in changelog Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
1 parent 4b2d48f commit 0fe9331

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@azure-tools/typespec-python"
5+
---
6+
7+
Add test cases for orphan model serialization

packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_usage_async.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ async def test_model_usage(client: UsageClient):
3131
) == await client.model_in_operation.model_in_read_only_property(body=models.RoundTripModel())
3232

3333

34-
# @pytest.mark.asyncio
35-
# async def test_orphan_model_serializable(client: UsageClient):
36-
# await client.model_in_operation.orphan_model_serializable(
37-
# body=models.OrphanModel(model_name="name", description="desc")
38-
# )
34+
@pytest.mark.asyncio
35+
async def test_orphan_model_serializable(client: UsageClient):
36+
await client.model_in_operation.orphan_model_serializable(
37+
body=models.OrphanModel(model_name="name", description="desc")
38+
)

packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ def test_model_usage(client: UsageClient):
2828
) == client.model_in_operation.model_in_read_only_property(body=models.RoundTripModel())
2929

3030

31-
# def test_orphan_model_serializable(client: UsageClient):
32-
# client.model_in_operation.orphan_model_serializable(body=models.OrphanModel(model_name="name", description="desc"))
31+
def test_orphan_model_serializable(client: UsageClient):
32+
client.model_in_operation.orphan_model_serializable(body=models.OrphanModel(model_name="name", description="desc"))

0 commit comments

Comments
 (0)