From 07ea00afbf4f7cc113fcf5b860e0e6080c79c5cd Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 01:47:02 +0000 Subject: [PATCH 1/5] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 1c69335bc8..d1ef88e2f0 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index b244704b3d..1c40139ad1 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { From c660097679a37d532fa675d5ab83df1bd6e10690 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 01:47:03 +0000 Subject: [PATCH 2/5] Add changelog --- .../changes/python-storagePagingFix-2026-0-26-16-51-19.md | 8 ++++++++ .../python-xmlErrorDeserialization-2026-0-28-11-40-34.md | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 .chronus/changes/python-storagePagingFix-2026-0-26-16-51-19.md create mode 100644 .chronus/changes/python-xmlErrorDeserialization-2026-0-28-11-40-34.md diff --git a/.chronus/changes/python-storagePagingFix-2026-0-26-16-51-19.md b/.chronus/changes/python-storagePagingFix-2026-0-26-16-51-19.md new file mode 100644 index 0000000000..64d71fba57 --- /dev/null +++ b/.chronus/changes/python-storagePagingFix-2026-0-26-16-51-19.md @@ -0,0 +1,8 @@ +--- +changeKind: fix +packages: + - "@autorest/python" + - "@azure-tools/typespec-python" +--- + +Fix additional indentation issues \ No newline at end of file diff --git a/.chronus/changes/python-xmlErrorDeserialization-2026-0-28-11-40-34.md b/.chronus/changes/python-xmlErrorDeserialization-2026-0-28-11-40-34.md new file mode 100644 index 0000000000..8daa3e8b86 --- /dev/null +++ b/.chronus/changes/python-xmlErrorDeserialization-2026-0-28-11-40-34.md @@ -0,0 +1,8 @@ +--- +changeKind: fix +packages: + - "@autorest/python" + - "@azure-tools/typespec-python" +--- + +`_failsafe_deserialize_xml` xml errors \ No newline at end of file From 8d04ff8f91973bae3a5d5b578ae0258a0480e702 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 01:49:14 +0000 Subject: [PATCH 3/5] Update dependencies (2026-01-29 01:49:13) --- .../test_model_base_xml_serialization.py | 92 ++++++------------- pnpm-lock.yaml | 14 +-- 2 files changed, 37 insertions(+), 69 deletions(-) diff --git a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py index 78912e305b..12011df99b 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py +++ b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py @@ -523,12 +523,10 @@ def __init__(self, *args, **kwargs): class TestXmlSerialization: def test_basic(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" 37 - """ - ) + """) class XmlModel(Model): age: int = rest_field(xml={"name": "Age"}) @@ -544,12 +542,8 @@ def __init__(self, *args, **kwargs): def test_basic_unicode(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring( - """ - """.encode( - "utf-8" - ) - ) + basic_xml = ET.fromstring(""" + """.encode("utf-8")) class XmlModel(Model): language: str = rest_field(xml={"name": "language", "attribute": True}) @@ -589,13 +583,11 @@ def __init__(self, *args, **kwargs): def test_type_basic(self): """Test basic types.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" 37 true - """ - ) + """) class XmlModel(Model): age: int = rest_field(name="age", xml={"name": "Age"}) @@ -611,10 +603,8 @@ def __init__(self, *args, **kwargs): def test_basic_text(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring( - """ - I am text""" - ) + basic_xml = ET.fromstring(""" + I am text""") class XmlModel(Model): language: str = rest_field(name="language", xml={"name": "language", "attribute": True}) @@ -630,15 +620,13 @@ def __init__(self, *args, **kwargs): def test_dict_type(self): """Test dict type.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" value1 value2 - """ - ) + """) class XmlModel(Model): metadata: Dict[str, str] = rest_field(name="Metadata", xml={"name": "Metadata"}) @@ -658,8 +646,7 @@ def __init__(self, *args, **kwargs): def test_additional_properties(self): """Test additional properties.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" test text @@ -672,8 +659,7 @@ def test_additional_properties(self): a b - """ - ) + """) class XmlModel(Model): name: str = rest_field(name="name", xml={"name": "Name"}) @@ -696,15 +682,13 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types(self): """Test XML list and wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples"}) @@ -720,13 +704,11 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types(self): """Test XML list and no wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "unwrapped": True}) @@ -742,15 +724,13 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types_items_name(self): """Test XML list and wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "itemsName": "string"}) @@ -766,13 +746,11 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types_items_name(self): """Test XML list and no wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field( @@ -791,15 +769,13 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" - """ - ) + """) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -824,13 +800,11 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" - """ - ) + """) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -852,13 +826,11 @@ def __init__(self, *args, **kwargs): def test_two_complex_same_type(self): """Two different attribute are same type""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" - """ - ) + """) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -883,12 +855,10 @@ def __init__(self, *args, **kwargs): def test_basic_namespace(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" 37 - """ - ) + """) class XmlModel(Model): age: int = rest_field( @@ -912,8 +882,7 @@ def __init__(self, *args, **kwargs): def test_complex_namespace(self): """Test recursive namespace.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" lmazuel @@ -926,8 +895,7 @@ def test_complex_namespace(self): 12 - """ - ) + """) class QueueDescriptionResponseAuthor(Model): name: str = rest_field(name="name", xml={"ns": "http://www.w3.org/2005/Atom"}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c4228beb5..d609397122 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1698,8 +1698,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.8.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz} version: 0.26.0 engines: {node: '>=20.0.0'} peerDependencies: @@ -6510,7 +6510,7 @@ snapshots: dependencies: '@typespec/compiler': 1.8.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwNDUwNy9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4)': dependencies: '@azure-tools/typespec-autorest': 0.64.0(5qtuclgmanejzupoeh5fzi2ury) '@azure-tools/typespec-azure-core': 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) From 7ddff6c8230b5f295197e8bd64cdf5b5628b6b74 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 01:54:57 +0000 Subject: [PATCH 4/5] Regenerate for typespec-python (2026-01-29 01:54:57) --- .../core/access/aio/operations/_operations.py | 6 ++---- .../core/access/operations/_operations.py | 6 ++---- .../specs/azure/core/traits/models/_enums.py | 5 ++--- .../documentation/aio/operations/_operations.py | 17 +++++++---------- .../documentation/operations/_operations.py | 17 +++++++---------- .../documentation/aio/operations/_operations.py | 17 +++++++---------- .../documentation/operations/_operations.py | 17 +++++++---------- 7 files changed, 34 insertions(+), 51 deletions(-) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py index 88bb949f0a..aec498f71b 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py @@ -545,8 +545,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: - """Expected query parameter: name="Madge" - Expected response body: + """Expected query parameter: name="Madge" Expected response body: .. code-block:: json @@ -615,8 +614,7 @@ async def _operation(self, *, name: str, **kwargs: Any) -> _models._models.Outer @distributed_trace_async async def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: - """Expected query parameter: kind="real" - Expected response body: + """Expected query parameter: kind="real" Expected response body: .. code-block:: json diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py index 901011e64d..b247db12f3 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py @@ -714,8 +714,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: - """Expected query parameter: name="Madge" - Expected response body: + """Expected query parameter: name="Madge" Expected response body: .. code-block:: json @@ -784,8 +783,7 @@ def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: @distributed_trace def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: - """Expected query parameter: kind="real" - Expected response body: + """Expected query parameter: kind="real" Expected response body: .. code-block:: json diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/models/_enums.py b/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/models/_enums.py index 1e2417ecdd..093d01e8a6 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/models/_enums.py +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/models/_enums.py @@ -18,6 +18,5 @@ class RepeatabilityResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): execution of the operation.""" REJECTED = "rejected" """If the request was rejected because the combination of Repeatability-First-Sent and - Repeatability-Request-ID were invalid - or because the Repeatability-First-Sent value was outside the range of values held by the - server.""" + Repeatability-Request-ID were invalid or because the Repeatability-First-Sent value was outside + the range of values held by the server.""" diff --git a/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/aio/operations/_operations.py index 55ce926f1e..b783a5ade0 100644 --- a/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/aio/operations/_operations.py @@ -300,9 +300,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def bold_text(self, **kwargs: Any) -> None: - """This is **bold text** in the middle of a sentence. - This is a sentence with **multiple bold** sections and **another bold** section. - **This entire sentence is bold.**. + """This is **bold text** in the middle of a sentence. This is a sentence with **multiple bold** + sections and **another bold** section. **This entire sentence is bold.**. :return: None :rtype: None @@ -346,9 +345,8 @@ async def bold_text(self, **kwargs: Any) -> None: @distributed_trace_async async def italic_text(self, **kwargs: Any) -> None: - """This is *italic text* in the middle of a sentence. - This is a sentence with *multiple italic* sections and *another italic* section. - *This entire sentence is italic.*. + """This is *italic text* in the middle of a sentence. This is a sentence with *multiple italic* + sections and *another italic* section. *This entire sentence is italic.*. :return: None :rtype: None @@ -392,10 +390,9 @@ async def italic_text(self, **kwargs: Any) -> None: @distributed_trace_async async def combined_formatting(self, **kwargs: Any) -> None: - """This sentence has **bold**, *italic*, and ***bold italic*** text. - You can also combine them like **bold with *italic inside* bold**. - Or *italic with **bold inside** italic*. - This is a sentence with **bold**, *italic*, and ***bold italic*** text. + """This sentence has **bold**, *italic*, and ***bold italic*** text. You can also combine them + like **bold with *italic inside* bold**. Or *italic with **bold inside** italic*. This is a + sentence with **bold**, *italic*, and ***bold italic*** text. :return: None :rtype: None diff --git a/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/operations/_operations.py b/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/operations/_operations.py index 908f28ffd9..48f21f0638 100644 --- a/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/specs-documentation/specs/documentation/operations/_operations.py @@ -342,9 +342,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def bold_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """This is **bold text** in the middle of a sentence. - This is a sentence with **multiple bold** sections and **another bold** section. - **This entire sentence is bold.**. + """This is **bold text** in the middle of a sentence. This is a sentence with **multiple bold** + sections and **another bold** section. **This entire sentence is bold.**. :return: None :rtype: None @@ -388,9 +387,8 @@ def bold_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu @distributed_trace def italic_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """This is *italic text* in the middle of a sentence. - This is a sentence with *multiple italic* sections and *another italic* section. - *This entire sentence is italic.*. + """This is *italic text* in the middle of a sentence. This is a sentence with *multiple italic* + sections and *another italic* section. *This entire sentence is italic.*. :return: None :rtype: None @@ -434,10 +432,9 @@ def italic_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re @distributed_trace def combined_formatting(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """This sentence has **bold**, *italic*, and ***bold italic*** text. - You can also combine them like **bold with *italic inside* bold**. - Or *italic with **bold inside** italic*. - This is a sentence with **bold**, *italic*, and ***bold italic*** text. + """This sentence has **bold**, *italic*, and ***bold italic*** text. You can also combine them + like **bold with *italic inside* bold**. Or *italic with **bold inside** italic*. This is a + sentence with **bold**, *italic*, and ***bold italic*** text. :return: None :rtype: None diff --git a/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/aio/operations/_operations.py index 9a3d47e026..f6bffb6bd7 100644 --- a/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/aio/operations/_operations.py @@ -283,9 +283,8 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def bold_text(self, **kwargs: Any) -> None: - """This is **bold text** in the middle of a sentence. - This is a sentence with **multiple bold** sections and **another bold** section. - **This entire sentence is bold.**. + """This is **bold text** in the middle of a sentence. This is a sentence with **multiple bold** + sections and **another bold** section. **This entire sentence is bold.**. :return: None :rtype: None @@ -326,9 +325,8 @@ async def bold_text(self, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore async def italic_text(self, **kwargs: Any) -> None: - """This is *italic text* in the middle of a sentence. - This is a sentence with *multiple italic* sections and *another italic* section. - *This entire sentence is italic.*. + """This is *italic text* in the middle of a sentence. This is a sentence with *multiple italic* + sections and *another italic* section. *This entire sentence is italic.*. :return: None :rtype: None @@ -369,10 +367,9 @@ async def italic_text(self, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore async def combined_formatting(self, **kwargs: Any) -> None: - """This sentence has **bold**, *italic*, and ***bold italic*** text. - You can also combine them like **bold with *italic inside* bold**. - Or *italic with **bold inside** italic*. - This is a sentence with **bold**, *italic*, and ***bold italic*** text. + """This sentence has **bold**, *italic*, and ***bold italic*** text. You can also combine them + like **bold with *italic inside* bold**. Or *italic with **bold inside** italic*. This is a + sentence with **bold**, *italic*, and ***bold italic*** text. :return: None :rtype: None diff --git a/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/operations/_operations.py index 62beb73a03..a514afc00d 100644 --- a/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/specs-documentation/specs/documentation/operations/_operations.py @@ -325,9 +325,8 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def bold_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """This is **bold text** in the middle of a sentence. - This is a sentence with **multiple bold** sections and **another bold** section. - **This entire sentence is bold.**. + """This is **bold text** in the middle of a sentence. This is a sentence with **multiple bold** + sections and **another bold** section. **This entire sentence is bold.**. :return: None :rtype: None @@ -368,9 +367,8 @@ def bold_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu return cls(pipeline_response, None, {}) # type: ignore def italic_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """This is *italic text* in the middle of a sentence. - This is a sentence with *multiple italic* sections and *another italic* section. - *This entire sentence is italic.*. + """This is *italic text* in the middle of a sentence. This is a sentence with *multiple italic* + sections and *another italic* section. *This entire sentence is italic.*. :return: None :rtype: None @@ -411,10 +409,9 @@ def italic_text(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re return cls(pipeline_response, None, {}) # type: ignore def combined_formatting(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """This sentence has **bold**, *italic*, and ***bold italic*** text. - You can also combine them like **bold with *italic inside* bold**. - Or *italic with **bold inside** italic*. - This is a sentence with **bold**, *italic*, and ***bold italic*** text. + """This sentence has **bold**, *italic*, and ***bold italic*** text. You can also combine them + like **bold with *italic inside* bold**. Or *italic with **bold inside** italic*. This is a + sentence with **bold**, *italic*, and ***bold italic*** text. :return: None :rtype: None From 3401c192887e39e4b121e3a1823667eee45f247f Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 02:09:43 +0000 Subject: [PATCH 5/5] Regenerate for autorest.python (2026-01-29 02:09:43) --- .../aio/operations/_operations.py | 14 ++- .../operations/_operations.py | 14 ++- .../aio/operations/_operations.py | 20 ++-- .../operations/_operations.py | 20 ++-- .../test_model_base_xml_serialization.py | 92 +++++++++++++------ 5 files changed, 90 insertions(+), 70 deletions(-) diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py index a11b4a093d..d843199536 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py @@ -57,8 +57,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def head_no_params(self, **kwargs: Any) -> JSON: - """Head request, no params. - Initially has no query parameters. After evolution, a new optional query parameter is added. + """Head request, no params. Initially has no query parameters. After evolution, a new optional + query parameter is added. :return: JSON :rtype: JSON @@ -106,9 +106,8 @@ async def head_no_params(self, **kwargs: Any) -> JSON: @distributed_trace_async async def get_required(self, *, parameter: str, **kwargs: Any) -> JSON: - """Get true Boolean value on path. - Initially only has one required Query Parameter. After evolution, a new optional query - parameter is added. + """Get true Boolean value on path. Initially only has one required Query Parameter. After + evolution, a new optional query parameter is added. :keyword parameter: I am a required parameter. Required. :paramtype parameter: str @@ -327,9 +326,8 @@ async def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any @distributed_trace_async async def get_optional(self, *, optional_param: Optional[str] = None, **kwargs: Any) -> JSON: - """Get true Boolean value on path. - Initially has one optional query parameter. After evolution, a new optional query parameter is - added. + """Get true Boolean value on path. Initially has one optional query parameter. After evolution, a + new optional query parameter is added. :keyword optional_param: I am an optional parameter. Default value is None. :paramtype optional_param: str diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py index d0fba17fa3..a54281a197 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py @@ -143,8 +143,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def head_no_params(self, **kwargs: Any) -> JSON: - """Head request, no params. - Initially has no query parameters. After evolution, a new optional query parameter is added. + """Head request, no params. Initially has no query parameters. After evolution, a new optional + query parameter is added. :return: JSON :rtype: JSON @@ -192,9 +192,8 @@ def head_no_params(self, **kwargs: Any) -> JSON: @distributed_trace def get_required(self, *, parameter: str, **kwargs: Any) -> JSON: - """Get true Boolean value on path. - Initially only has one required Query Parameter. After evolution, a new optional query - parameter is added. + """Get true Boolean value on path. Initially only has one required Query Parameter. After + evolution, a new optional query parameter is added. :keyword parameter: I am a required parameter. Required. :paramtype parameter: str @@ -411,9 +410,8 @@ def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any) -> J @distributed_trace def get_optional(self, *, optional_param: Optional[str] = None, **kwargs: Any) -> JSON: - """Get true Boolean value on path. - Initially has one optional query parameter. After evolution, a new optional query parameter is - added. + """Get true Boolean value on path. Initially has one optional query parameter. After evolution, a + new optional query parameter is added. :keyword optional_param: I am an optional parameter. Default value is None. :paramtype optional_param: str diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py index 9a47993eed..466e1740b0 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py @@ -111,9 +111,8 @@ async def head_no_params(self, *, new_parameter: Optional[str] = None, **kwargs: @distributed_trace_async async def get_required(self, *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any) -> JSON: - """Get true Boolean value on path. - Initially only has one required Query Parameter. After evolution, a new optional query - parameter is added. + """Get true Boolean value on path. Initially only has one required Query Parameter. After + evolution, a new optional query parameter is added. :keyword parameter: I am a required parameter. Required. :paramtype parameter: str @@ -346,9 +345,8 @@ async def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any @distributed_trace_async async def delete_parameters(self, **kwargs: Any) -> None: - """Delete something. - Initially the path exists but there is no delete method. After evolution this is a new method - in a known path. + """Delete something. Initially the path exists but there is no delete method. After evolution this + is a new method in a known path. :return: None :rtype: None @@ -391,9 +389,8 @@ async def delete_parameters(self, **kwargs: Any) -> None: async def get_optional( self, *, optional_param: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any ) -> JSON: - """Get true Boolean value on path. - Initially has one optional query parameter. After evolution, a new optional query parameter is - added. + """Get true Boolean value on path. Initially has one optional query parameter. After evolution, a + new optional query parameter is added. :keyword optional_param: I am an optional parameter. Default value is None. :paramtype optional_param: str @@ -447,9 +444,8 @@ async def get_optional( @distributed_trace_async async def get_new_operation(self, **kwargs: Any) -> JSON: - """I'm a new operation. - Initiallty neither path or method exist for this operation. After evolution, this is a new - method in a new path. + """I'm a new operation. Initiallty neither path or method exist for this operation. After + evolution, this is a new method in a new path. :return: JSON :rtype: JSON diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py index 5fb01fb551..3ffe49becd 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py @@ -231,9 +231,8 @@ def head_no_params(self, *, new_parameter: Optional[str] = None, **kwargs: Any) @distributed_trace def get_required(self, *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any) -> JSON: - """Get true Boolean value on path. - Initially only has one required Query Parameter. After evolution, a new optional query - parameter is added. + """Get true Boolean value on path. Initially only has one required Query Parameter. After + evolution, a new optional query parameter is added. :keyword parameter: I am a required parameter. Required. :paramtype parameter: str @@ -466,9 +465,8 @@ def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any) -> J @distributed_trace def delete_parameters(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete something. - Initially the path exists but there is no delete method. After evolution this is a new method - in a known path. + """Delete something. Initially the path exists but there is no delete method. After evolution this + is a new method in a known path. :return: None :rtype: None @@ -511,9 +509,8 @@ def delete_parameters(self, **kwargs: Any) -> None: # pylint: disable=inconsist def get_optional( self, *, optional_param: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any ) -> JSON: - """Get true Boolean value on path. - Initially has one optional query parameter. After evolution, a new optional query parameter is - added. + """Get true Boolean value on path. Initially has one optional query parameter. After evolution, a + new optional query parameter is added. :keyword optional_param: I am an optional parameter. Default value is None. :paramtype optional_param: str @@ -567,9 +564,8 @@ def get_optional( @distributed_trace def get_new_operation(self, **kwargs: Any) -> JSON: - """I'm a new operation. - Initiallty neither path or method exist for this operation. After evolution, this is a new - method in a new path. + """I'm a new operation. Initiallty neither path or method exist for this operation. After + evolution, this is a new method in a new path. :return: JSON :rtype: JSON diff --git a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py index 12011df99b..78912e305b 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py +++ b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py @@ -523,10 +523,12 @@ def __init__(self, *args, **kwargs): class TestXmlSerialization: def test_basic(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ 37 - """) + """ + ) class XmlModel(Model): age: int = rest_field(xml={"name": "Age"}) @@ -542,8 +544,12 @@ def __init__(self, *args, **kwargs): def test_basic_unicode(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring(""" - """.encode("utf-8")) + basic_xml = ET.fromstring( + """ + """.encode( + "utf-8" + ) + ) class XmlModel(Model): language: str = rest_field(xml={"name": "language", "attribute": True}) @@ -583,11 +589,13 @@ def __init__(self, *args, **kwargs): def test_type_basic(self): """Test basic types.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ 37 true - """) + """ + ) class XmlModel(Model): age: int = rest_field(name="age", xml={"name": "Age"}) @@ -603,8 +611,10 @@ def __init__(self, *args, **kwargs): def test_basic_text(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring(""" - I am text""") + basic_xml = ET.fromstring( + """ + I am text""" + ) class XmlModel(Model): language: str = rest_field(name="language", xml={"name": "language", "attribute": True}) @@ -620,13 +630,15 @@ def __init__(self, *args, **kwargs): def test_dict_type(self): """Test dict type.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ value1 value2 - """) + """ + ) class XmlModel(Model): metadata: Dict[str, str] = rest_field(name="Metadata", xml={"name": "Metadata"}) @@ -646,7 +658,8 @@ def __init__(self, *args, **kwargs): def test_additional_properties(self): """Test additional properties.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ test text @@ -659,7 +672,8 @@ def test_additional_properties(self): a b - """) + """ + ) class XmlModel(Model): name: str = rest_field(name="name", xml={"name": "Name"}) @@ -682,13 +696,15 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types(self): """Test XML list and wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples"}) @@ -704,11 +720,13 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types(self): """Test XML list and no wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "unwrapped": True}) @@ -724,13 +742,15 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types_items_name(self): """Test XML list and wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "itemsName": "string"}) @@ -746,11 +766,13 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types_items_name(self): """Test XML list and no wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field( @@ -769,13 +791,15 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ - """) + """ + ) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -800,11 +824,13 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ - """) + """ + ) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -826,11 +852,13 @@ def __init__(self, *args, **kwargs): def test_two_complex_same_type(self): """Two different attribute are same type""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ - """) + """ + ) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -855,10 +883,12 @@ def __init__(self, *args, **kwargs): def test_basic_namespace(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ 37 - """) + """ + ) class XmlModel(Model): age: int = rest_field( @@ -882,7 +912,8 @@ def __init__(self, *args, **kwargs): def test_complex_namespace(self): """Test recursive namespace.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ lmazuel @@ -895,7 +926,8 @@ def test_complex_namespace(self): 12 - """) + """ + ) class QueueDescriptionResponseAuthor(Model): name: str = rest_field(name="name", xml={"ns": "http://www.w3.org/2005/Atom"})