Skip to content
Merged
8 changes: 8 additions & 0 deletions .chronus/changes/python-fix-nightly-2026-0-20-15-4-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

support "apiVersions" of TCGC metadata
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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTc2OTYzMy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.24.1.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTc3Mjk2OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.24.1.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
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 @@ -67,7 +67,7 @@
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
"tsx": "~4.19.1",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTc2OTYzMy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.24.1.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTc3Mjk2OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.24.1.tgz",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,99 @@ async def test_newline_delimited(client: ArrayClient):
body = models.NewlineDelimitedArrayProperty(value=["blue", "red", "green"])
result = await client.property.newline_delimited(body)
assert result.value == ["blue", "red", "green"]


@pytest.mark.asyncio
async def test_enum_comma_delimited(client: ArrayClient):
body = models.CommaDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = await client.property.enum_comma_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


@pytest.mark.asyncio
async def test_enum_space_delimited(client: ArrayClient):
body = models.SpaceDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = await client.property.enum_space_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


@pytest.mark.asyncio
async def test_enum_pipe_delimited(client: ArrayClient):
body = models.PipeDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = await client.property.enum_pipe_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


@pytest.mark.asyncio
async def test_enum_newline_delimited(client: ArrayClient):
body = models.NewlineDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = await client.property.enum_newline_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


@pytest.mark.asyncio
async def test_extensible_enum_comma_delimited(client: ArrayClient):
body = models.CommaDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = await client.property.extensible_enum_comma_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]


@pytest.mark.asyncio
async def test_extensible_enum_space_delimited(client: ArrayClient):
body = models.SpaceDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = await client.property.extensible_enum_space_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]


@pytest.mark.asyncio
async def test_extensible_enum_pipe_delimited(client: ArrayClient):
body = models.PipeDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = await client.property.extensible_enum_pipe_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]


@pytest.mark.asyncio
async def test_extensible_enum_newline_delimited(client: ArrayClient):
body = models.NewlineDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = await client.property.extensible_enum_newline_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,91 @@ def test_newline_delimited(client: ArrayClient):
body = models.NewlineDelimitedArrayProperty(value=["blue", "red", "green"])
result = client.property.newline_delimited(body)
assert result.value == ["blue", "red", "green"]


def test_enum_comma_delimited(client: ArrayClient):
body = models.CommaDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = client.property.enum_comma_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


def test_enum_space_delimited(client: ArrayClient):
body = models.SpaceDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = client.property.enum_space_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


def test_enum_pipe_delimited(client: ArrayClient):
body = models.PipeDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = client.property.enum_pipe_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


def test_enum_newline_delimited(client: ArrayClient):
body = models.NewlineDelimitedEnumArrayProperty(value=[models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN])
result = client.property.enum_newline_delimited(body)
assert result.value == [models.Colors.BLUE, models.Colors.RED, models.Colors.GREEN]


def test_extensible_enum_comma_delimited(client: ArrayClient):
body = models.CommaDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = client.property.extensible_enum_comma_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]


def test_extensible_enum_space_delimited(client: ArrayClient):
body = models.SpaceDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = client.property.extensible_enum_space_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]


def test_extensible_enum_pipe_delimited(client: ArrayClient):
body = models.PipeDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = client.property.extensible_enum_pipe_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]


def test_extensible_enum_newline_delimited(client: ArrayClient):
body = models.NewlineDelimitedExtensibleEnumArrayProperty(
value=[
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
)
result = client.property.extensible_enum_newline_delimited(body)
assert result.value == [
models.ColorsExtensibleEnum.BLUE,
models.ColorsExtensibleEnum.RED,
models.ColorsExtensibleEnum.GREEN,
]
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