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"
---

Add mock API test cases for operation body parameters with reserved names (e.g., `items`) to verify the wire name is not mangled.
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@ async def test_model_properties_with_list(client: SpecialWordsClient):
async def test_extensible_strings(client: SpecialWordsClient):
for enum_value in models.ExtensibleString:
assert enum_value == await client.extensible_strings.put_extensible_string_value(body=enum_value)


@pytest.mark.asyncio
async def test_reserved_operation_body_params_with_items(client: SpecialWordsClient):
await client.reserved_operation_body_params.with_items(items=["item"])
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ def test_model_properties_with_list(client: SpecialWordsClient):
def test_extensible_strings(client: SpecialWordsClient):
for enum_value in models.ExtensibleString:
assert enum_value == client.extensible_strings.put_extensible_string_value(body=enum_value)


def test_reserved_operation_body_params_with_items(client: SpecialWordsClient):
client.reserved_operation_body_params.with_items(items=["item"])
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,8 @@ async def test_model_properties_with_list(client: SpecialWordsClient):
async def test_extensible_strings(client: SpecialWordsClient):
for enum_value in extensible_strings_models.ExtensibleString:
assert enum_value == await client.extensible_strings.put_extensible_string_value(body=enum_value)


@pytest.mark.asyncio
async def test_reserved_operation_body_params_with_items(client: SpecialWordsClient):
await client.reserved_operation_body_params.with_items(items=["item"])
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ def test_model_properties_with_list(client: SpecialWordsClient):
def test_extensible_strings(client: SpecialWordsClient):
for enum_value in extensible_strings_models.ExtensibleString:
assert enum_value == client.extensible_strings.put_extensible_string_value(body=enum_value)


def test_reserved_operation_body_params_with_items(client: SpecialWordsClient):
client.reserved_operation_body_params.with_items(items=["item"])