Skip to content
Open
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: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Fix PermissionError when detecting package manager on WSL
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Update internal npm feed from azure-sdk-for-js-test-autorest to azure-sdk-for-js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Add mock API test cases for XML scenarios introduced in https://github.com/microsoft/typespec/pull/10063, covering: renamed property, nested model, renamed nested model, wrapped primitive with custom item names, model array variants (wrapped/unwrapped/renamed), renamed attribute, namespace, and namespace-on-properties. Tests for unwrapped model array serialization and namespace handling are skipped pending generator bug fixes.
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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjAzMjIxMi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.0.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjAzODE4Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.0.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
4 changes: 2 additions & 2 deletions 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.21.0",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjAzMjIxMi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.0.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjAzODE4Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.0.tgz",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand All @@ -87,7 +87,7 @@
"@azure-tools/typespec-autorest": "~0.66.0",
"@azure-tools/typespec-client-generator-core": "~0.66.2",
"@azure-tools/azure-http-specs": "0.1.0-alpha.39-dev.4",
"@typespec/http-specs": "0.1.0-alpha.35-dev.4",
"@typespec/http-specs": "0.1.0-alpha.35-dev.5",
"@typespec/spector": "0.1.0-alpha.24",
"@typespec/spec-api": "0.1.0-alpha.14-dev.1",
"@types/js-yaml": "~4.0.5",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils import recorded_by_proxy
from testpreparer import XmlClientTestBase, XmlPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithNamespaceOnPropertiesValueOperations(XmlClientTestBase):
@XmlPreparer()
@recorded_by_proxy
def test_model_with_namespace_on_properties_value_get(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_namespace_on_properties_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy
def test_model_with_namespace_on_properties_value_put(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_namespace_on_properties_value.put(
input={"author": "str", "id": 0, "title": "str"},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils.aio import recorded_by_proxy_async
from testpreparer import XmlPreparer
from testpreparer_async import XmlClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithNamespaceOnPropertiesValueOperationsAsync(XmlClientTestBaseAsync):
@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_namespace_on_properties_value_get(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_namespace_on_properties_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_namespace_on_properties_value_put(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_namespace_on_properties_value.put(
input={"author": "str", "id": 0, "title": "str"},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils import recorded_by_proxy
from testpreparer import XmlClientTestBase, XmlPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithNamespaceValueOperations(XmlClientTestBase):
@XmlPreparer()
@recorded_by_proxy
def test_model_with_namespace_value_get(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_namespace_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy
def test_model_with_namespace_value_put(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_namespace_value.put(
input={"id": 0, "title": "str"},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils.aio import recorded_by_proxy_async
from testpreparer import XmlPreparer
from testpreparer_async import XmlClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithNamespaceValueOperationsAsync(XmlClientTestBaseAsync):
@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_namespace_value_get(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_namespace_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_namespace_value_put(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_namespace_value.put(
input={"id": 0, "title": "str"},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils import recorded_by_proxy
from testpreparer import XmlClientTestBase, XmlPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithNestedModelValueOperations(XmlClientTestBase):
@XmlPreparer()
@recorded_by_proxy
def test_model_with_nested_model_value_get(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_nested_model_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy
def test_model_with_nested_model_value_put(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_nested_model_value.put(
input={"nested": {"age": 0, "name": "str"}},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils.aio import recorded_by_proxy_async
from testpreparer import XmlPreparer
from testpreparer_async import XmlClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithNestedModelValueOperationsAsync(XmlClientTestBaseAsync):
@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_nested_model_value_get(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_nested_model_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_nested_model_value_put(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_nested_model_value.put(
input={"nested": {"age": 0, "name": "str"}},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils import recorded_by_proxy
from testpreparer import XmlClientTestBase, XmlPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithRenamedAttributeValueOperations(XmlClientTestBase):
@XmlPreparer()
@recorded_by_proxy
def test_model_with_renamed_attribute_value_get(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_renamed_attribute_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy
def test_model_with_renamed_attribute_value_put(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_renamed_attribute_value.put(
input={"author": "str", "id": 0, "title": "str"},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils.aio import recorded_by_proxy_async
from testpreparer import XmlPreparer
from testpreparer_async import XmlClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithRenamedAttributeValueOperationsAsync(XmlClientTestBaseAsync):
@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_renamed_attribute_value_get(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_renamed_attribute_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy_async
async def test_model_with_renamed_attribute_value_put(self, xml_endpoint):
client = self.create_async_client(endpoint=xml_endpoint)
response = await client.model_with_renamed_attribute_value.put(
input={"author": "str", "id": 0, "title": "str"},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils import recorded_by_proxy
from testpreparer import XmlClientTestBase, XmlPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestXmlModelWithRenamedNestedModelValueOperations(XmlClientTestBase):
@XmlPreparer()
@recorded_by_proxy
def test_model_with_renamed_nested_model_value_get(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_renamed_nested_model_value.get()

# please add some check logic here by yourself
# ...

@XmlPreparer()
@recorded_by_proxy
def test_model_with_renamed_nested_model_value_put(self, xml_endpoint):
client = self.create_client(endpoint=xml_endpoint)
response = client.model_with_renamed_nested_model_value.put(
input={"author": {"name": "str"}},
content_type="str",
)

# please add some check logic here by yourself
# ...
Loading
Loading