Skip to content
Merged
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"
---

Update test cases for Azure/typespec-azure#3997: replace `@operationGroup` with `@client` decorator changes. Remove deleted `multi-service-older-versions` tests and update client structure, naming tests to reflect new flat client hierarchy.
3 changes: 3 additions & 0 deletions packages/http-client-python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ generator/test/.diff-summary.md

# Regeneration marker (tracks when generated code was last regenerated)
.last-regenerate

# local folder for debug
alpha

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ async def client():

@pytest.mark.asyncio
async def test_client(client: NamingClient):
await client.client(models.ClientNameModel(client_name=True))
await client.property.client(models.ClientNameModel(client_name=True))


@pytest.mark.asyncio
async def test_language(client: NamingClient):
await client.language(models.LanguageClientNameModel(python_name=True))
await client.property.language(models.LanguageClientNameModel(python_name=True))


@pytest.mark.asyncio
async def test_compatible_with_encoded_name(client: NamingClient):
await client.compatible_with_encoded_name(models.ClientNameAndJsonEncodedNameModel(client_name=True))
await client.property.compatible_with_encoded_name(models.ClientNameAndJsonEncodedNameModel(client_name=True))


@pytest.mark.asyncio
Expand All @@ -41,12 +41,12 @@ async def test_parameter(client: NamingClient):

@pytest.mark.asyncio
async def test_header_request(client: NamingClient):
await client.request(client_name="true")
await client.header.request(client_name="true")


@pytest.mark.asyncio
async def test_header_response(client: NamingClient):
assert (await client.response(cls=lambda x, y, z: z))["default-name"] == "true"
assert (await client.header.response(cls=lambda x, y, z: z))["default-name"] == "true"


@pytest.mark.asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ async def test_structure_renamed_operation():
await client.renamed_three()
await client.renamed_five()

await client.group.renamed_two()
await client.group.renamed_four()
await client.group.renamed_six()
await client.renamed_two()
await client.renamed_four()
await client.renamed_six()


@pytest.mark.asyncio
async def test_structure_two_operation_group():
client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.RENAMED_OPERATION)
await client.group1.one()
await client.group1.three()
await client.group1.four()

await client.group2.two()
await client.group2.five()
await client.group2.six()
client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.TWO_OPERATION_GROUP)
await client.one()
await client.three()
await client.four()

await client.two()
await client.five()
await client.six()
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async def test_first_client_operations():

await client.one()

await client.group3.two()
await client.group3.three()
await client.two()
await client.three()

await client.group4.four()
await client.four()


@pytest.mark.asyncio
Expand All @@ -26,4 +26,4 @@ async def test_second_client_operations():

await client.five()

await client.group5.six()
await client.six()

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ def client():


def test_client(client: NamingClient):
client.client(models.ClientNameModel(client_name=True))
client.property.client(models.ClientNameModel(client_name=True))


def test_language(client: NamingClient):
client.language(models.LanguageClientNameModel(python_name=True))
client.property.language(models.LanguageClientNameModel(python_name=True))


def test_compatible_with_encoded_name(client: NamingClient):
client.compatible_with_encoded_name(models.ClientNameAndJsonEncodedNameModel(client_name=True))
client.property.compatible_with_encoded_name(models.ClientNameAndJsonEncodedNameModel(client_name=True))


def test_operation(client: NamingClient):
Expand All @@ -34,11 +34,11 @@ def test_parameter(client: NamingClient):


def test_header_request(client: NamingClient):
client.request(client_name="true")
client.header.request(client_name="true")


def test_header_response(client: NamingClient):
assert client.response(cls=lambda x, y, z: z)["default-name"] == "true"
assert client.header.response(cls=lambda x, y, z: z)["default-name"] == "true"


def test_model_client(client: NamingClient):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def test_structure_renamed_operation():
client.renamed_three()
client.renamed_five()

client.group.renamed_two()
client.group.renamed_four()
client.group.renamed_six()
client.renamed_two()
client.renamed_four()
client.renamed_six()


def test_structure_two_operation_group():
client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.TWO_OPERATION_GROUP)
client.group1.one()
client.group1.three()
client.group1.four()
client.one()
client.three()
client.four()

client.group2.two()
client.group2.five()
client.group2.six()
client.two()
client.five()
client.six()
Loading
Loading