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,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Enable previously skipped client structure and client operation group mock API tests after TCGC 0.67.0 upgrade; remove obsolete `test_spread_record_discriminated_union` tests whose Spector scenario was removed.
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjEyMjcwMy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjEyMzY4MS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@typespec/xml": ">=0.81.0 <1.0.0"
},
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjEyMjcwMy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjEyMzY4MS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"fs-extra": "~11.2.0",
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,25 @@ async def test_structure_multiclient():
await client_b.renamed_six()


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
@pytest.mark.asyncio
async def test_structure_renamed_operation():
client = RenamedOperationClient(endpoint="http://localhost:3000", client=ClientType.RENAMED_OPERATION)
await client.renamed_one()
await client.renamed_three()
await client.renamed_five()

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


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
@pytest.mark.asyncio
async def test_structure_two_operation_group():
client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.TWO_OPERATION_GROUP)
await client.one()
await client.three()
await client.four()
await client.group1.one()
await client.group1.three()
await client.group1.four()

await client.two()
await client.five()
await client.six()
await client.group2.two()
await client.group2.five()
await client.group2.six()
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@
from client.structure.clientoperationgroup.aio import FirstClient, SecondClient


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
@pytest.mark.asyncio
async def test_first_client_operations():
client = FirstClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP)

await client.one()

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

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


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
@pytest.mark.asyncio
async def test_second_client_operations():
client = SecondClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP)

await client.five()

await client.six()
await client.group5.six()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import pytest
from client.structure.service.models import ClientType
from client.structure.service import ServiceClient
from client.structure.multiclient import ClientAClient, ClientBClient
Expand Down Expand Up @@ -36,25 +35,23 @@ def test_structure_multiclient():
client_b.renamed_six()


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
def test_structure_renamed_operation():
client = RenamedOperationClient(endpoint="http://localhost:3000", client=ClientType.RENAMED_OPERATION)
client.renamed_one()
client.renamed_three()
client.renamed_five()

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


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
def test_structure_two_operation_group():
client = TwoOperationGroupClient(endpoint="http://localhost:3000", client=ClientType.TWO_OPERATION_GROUP)
client.one()
client.three()
client.four()
client.group1.one()
client.group1.three()
client.group1.four()

client.two()
client.five()
client.six()
client.group2.two()
client.group2.five()
client.group2.six()
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import pytest
from client.structure.clientoperationgroup.models import ClientType
from client.structure.clientoperationgroup import FirstClient, SecondClient


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
def test_first_client_operations():
client = FirstClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP)

client.one()

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

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


@pytest.mark.skip(reason="will reopen the cases after upgrade `@azure-tools/typespec-client-generator-core` to 0.67.0")
def test_second_client_operations():
client = SecondClient(endpoint="http://localhost:3000", client=ClientType.CLIENT_OPERATION_GROUP)

client.five()

client.six()
client.group5.six()
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,6 @@ async def test_spread_model_array(client: AdditionalPropertiesClient):
await client.spread_model_array.put(body)


@pytest.mark.skip(reason="https://github.com/microsoft/typespec/pull/6425")
@pytest.mark.asyncio
async def test_spread_record_discriminated_union(client: AdditionalPropertiesClient):
body = {
"name": "abc",
"prop1": {"fooProp": "abc", "kind": "kind0"},
"prop2": {
"end": "2021-01-02T00:00:00Z",
"kind": "kind1",
"start": "2021-01-01T00:00:00Z",
},
}
assert await client.spread_record_discriminated_union.get() == body
await client.spread_record_discriminated_union.put(body)


@pytest.mark.asyncio
async def test_spread_record_non_discriminated_union(
client: AdditionalPropertiesClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,21 +236,6 @@ def test_spread_model_array(client: AdditionalPropertiesClient):
client.spread_model_array.put(body)


@pytest.mark.skip(reason="https://github.com/microsoft/typespec/pull/6425")
def test_spread_record_discriminated_union(client: AdditionalPropertiesClient):
body = {
"name": "abc",
"prop1": {"fooProp": "abc", "kind": "kind0"},
"prop2": {
"end": "2021-01-02T00:00:00Z",
"kind": "kind1",
"start": "2021-01-01T00:00:00Z",
},
}
assert client.spread_record_discriminated_union.get() == body
client.spread_record_discriminated_union.put(body)


def test_spread_record_non_discriminated_union(client: AdditionalPropertiesClient):
body = {
"name": "abc",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading