@typespec/http-client-python 0.28.1 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter/code-model.d.ts.map +1 -1
- package/dist/emitter/code-model.js +6 -6
- package/dist/emitter/code-model.js.map +1 -1
- package/dist/emitter/emitter.d.ts.map +1 -1
- package/dist/emitter/emitter.js +27 -28
- package/dist/emitter/emitter.js.map +1 -1
- package/dist/emitter/lib.d.ts +4 -1
- package/dist/emitter/lib.d.ts.map +1 -1
- package/dist/emitter/lib.js.map +1 -1
- package/dist/emitter/system-requirements.js +6 -4
- package/dist/emitter/system-requirements.js.map +1 -1
- package/dist/emitter/types.d.ts +2 -5
- package/dist/emitter/types.d.ts.map +1 -1
- package/dist/emitter/types.js +55 -58
- package/dist/emitter/types.js.map +1 -1
- package/dist/emitter/utils.d.ts.map +1 -1
- package/dist/emitter/utils.js +16 -17
- package/dist/emitter/utils.js.map +1 -1
- package/emitter/src/code-model.ts +6 -13
- package/emitter/src/emitter.ts +29 -31
- package/emitter/src/lib.ts +4 -0
- package/emitter/src/system-requirements.ts +4 -4
- package/emitter/src/types.ts +67 -57
- package/emitter/src/utils.ts +16 -18
- package/emitter/temp/tsconfig.tsbuildinfo +1 -1
- package/eng/scripts/Build-Packages.ps1 +62 -37
- package/eng/scripts/Check-GitChanges.ps1 +30 -3
- package/eng/scripts/Functions.ps1 +54 -15
- package/eng/scripts/Generate.ps1 +42 -8
- package/eng/scripts/Generation.psm1 +44 -15
- package/eng/scripts/Initialize-Repository.ps1 +29 -11
- package/eng/scripts/Test-Packages.ps1 +47 -31
- package/eng/scripts/ci/config/eslint-ci.config.mjs +54 -0
- package/eng/scripts/ci/dev_requirements.txt +1 -0
- package/eng/scripts/ci/format.ts +232 -2
- package/eng/scripts/ci/lint.ts +216 -20
- package/eng/scripts/ci/regenerate-common.ts +18 -14
- package/eng/scripts/ci/regenerate.ts +305 -68
- package/eng/scripts/ci/run-tests.ts +402 -0
- package/eng/scripts/ci/run_mypy.py +4 -3
- package/eng/scripts/ci/run_pylint.py +4 -3
- package/eng/scripts/ci/run_pyright.py +4 -3
- package/eng/scripts/ci/typecheck.ts +225 -0
- package/eng/scripts/ci/util.py +1 -1
- package/eng/scripts/ci/utils.ts +5 -5
- package/eng/scripts/setup/__pycache__/package_manager.cpython-311.pyc +0 -0
- package/eng/scripts/setup/__pycache__/venvtools.cpython-311.pyc +0 -0
- package/eng/scripts/setup/build.ts +1 -1
- package/eng/scripts/setup/build_pygen_wheel.py +1 -0
- package/eng/scripts/setup/install.py +1 -0
- package/eng/scripts/setup/prepare.py +1 -0
- package/eng/scripts/setup/prepare.ts +1 -1
- package/eng/scripts/setup/run_tsp.py +3 -3
- package/eng/scripts/setup/system-requirements.ts +8 -4
- package/eng/scripts/setup/venvtools.py +1 -0
- package/generator/build/lib/pygen/codegen/models/operation.py +9 -8
- package/generator/build/lib/pygen/codegen/templates/model_base.py.jinja2 +157 -64
- package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
- package/generator/pygen/codegen/models/operation.py +9 -8
- package/generator/pygen/codegen/templates/model_base.py.jinja2 +157 -64
- package/package.json +48 -42
- package/eng/scripts/ci/run-ci.ts +0 -89
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_commonproperties_async.py +0 -94
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_largeheader_async.py +0 -30
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_nonresource_async.py +0 -36
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_operationtemplates_async.py +0 -205
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_resource_async.py +0 -478
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_access_async.py +0 -101
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_api_version_header_async.py +0 -18
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_api_version_path_async.py +0 -18
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_api_version_query_async.py +0 -18
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_client_default_value_async.py +0 -46
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_client_initialization_async.py +0 -58
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_client_location_async.py +0 -82
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_deserialize_empty_string_as_null_async.py +0 -20
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_flatten_async.py +0 -115
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py +0 -53
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_next_link_verb_async.py +0 -28
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_override_async.py +0 -106
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_usage_async.py +0 -38
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_basic_async.py +0 -76
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_lro_rpc_async.py +0 -22
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_lro_standard_async.py +0 -39
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_model_async.py +0 -33
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_page_async.py +0 -80
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_scalar_async.py +0 -41
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_core_traits_async.py +0 -87
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_encode_duration_async.py +0 -19
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_example_basic_async.py +0 -30
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_payload_pageable_async.py +0 -19
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_resource_manager_method_subscription_id_async.py +0 -248
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_resource_manager_multi_service_async.py +0 -110
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_resource_manager_multi_service_shared_models_async.py +0 -132
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_special_headers_client_request_id_async.py +0 -30
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_versioning_previewversion_async.py +0 -53
- package/generator/test/azure/mock_api_tests/asynctests/test_client_namespace_async.py +0 -34
- package/generator/test/azure/mock_api_tests/asynctests/test_client_naming_async.py +0 -69
- package/generator/test/azure/mock_api_tests/asynctests/test_client_naming_enum_conflict_async.py +0 -37
- package/generator/test/azure/mock_api_tests/asynctests/test_client_overload_async.py +0 -27
- package/generator/test/azure/mock_api_tests/asynctests/test_client_structure_async.py +0 -64
- package/generator/test/azure/mock_api_tests/asynctests/test_client_structure_clientoperationgroup_async.py +0 -31
- package/generator/test/azure/mock_api_tests/asynctests/test_encode_duration_async.py +0 -63
- package/generator/test/azure/mock_api_tests/asynctests/test_encode_numeric_async.py +0 -35
- package/generator/test/azure/mock_api_tests/asynctests/test_parameters_basic_async.py +0 -24
- package/generator/test/azure/mock_api_tests/asynctests/test_parameters_spread_async.py +0 -76
- package/generator/test/azure/mock_api_tests/asynctests/test_payload_content_negotiation_async.py +0 -37
- package/generator/test/azure/mock_api_tests/asynctests/test_payload_multipart_async.py +0 -216
- package/generator/test/azure/mock_api_tests/asynctests/test_resiliency_srv_driven_async.py +0 -130
- package/generator/test/azure/mock_api_tests/asynctests/test_serialization_encoded_name_json_async.py +0 -24
- package/generator/test/azure/mock_api_tests/asynctests/test_service_multi_service_async.py +0 -31
- package/generator/test/azure/mock_api_tests/asynctests/test_special_words_async.py +0 -71
- package/generator/test/azure/mock_api_tests/conftest.py +0 -207
- package/generator/test/azure/mock_api_tests/data/image.jpg +0 -0
- package/generator/test/azure/mock_api_tests/data/image.png +0 -0
- package/generator/test/azure/mock_api_tests/test_azure_arm_commonproperties.py +0 -89
- package/generator/test/azure/mock_api_tests/test_azure_arm_largeheader.py +0 -27
- package/generator/test/azure/mock_api_tests/test_azure_arm_nonresource.py +0 -34
- package/generator/test/azure/mock_api_tests/test_azure_arm_operationtemplates.py +0 -180
- package/generator/test/azure/mock_api_tests/test_azure_arm_resource.py +0 -436
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_access.py +0 -92
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_api_version_header.py +0 -17
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_api_version_path.py +0 -17
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_api_version_query.py +0 -17
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_client_default_value.py +0 -42
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_client_initialization.py +0 -51
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_client_location.py +0 -70
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_deserialize_empty_string_as_null.py +0 -19
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_flatten.py +0 -104
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_hierrarchy_building.py +0 -45
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_next_link_verb.py +0 -27
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_override.py +0 -102
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_usage.py +0 -32
- package/generator/test/azure/mock_api_tests/test_azure_core_basic.py +0 -70
- package/generator/test/azure/mock_api_tests/test_azure_core_lro_rpc.py +0 -20
- package/generator/test/azure/mock_api_tests/test_azure_core_lro_standard.py +0 -32
- package/generator/test/azure/mock_api_tests/test_azure_core_model.py +0 -30
- package/generator/test/azure/mock_api_tests/test_azure_core_page.py +0 -71
- package/generator/test/azure/mock_api_tests/test_azure_core_scalar.py +0 -35
- package/generator/test/azure/mock_api_tests/test_azure_core_traits.py +0 -85
- package/generator/test/azure/mock_api_tests/test_azure_encode_duration.py +0 -18
- package/generator/test/azure/mock_api_tests/test_azure_example_basic.py +0 -29
- package/generator/test/azure/mock_api_tests/test_azure_payload_pageable.py +0 -18
- package/generator/test/azure/mock_api_tests/test_azure_resource_manager_method_subscription_id.py +0 -235
- package/generator/test/azure/mock_api_tests/test_azure_resource_manager_multi_service.py +0 -104
- package/generator/test/azure/mock_api_tests/test_azure_resource_manager_multi_service_shared_models.py +0 -128
- package/generator/test/azure/mock_api_tests/test_azure_special_headers_client_request_id.py +0 -29
- package/generator/test/azure/mock_api_tests/test_azure_versioning_previewversion.py +0 -50
- package/generator/test/azure/mock_api_tests/test_clear_output_folder.py +0 -23
- package/generator/test/azure/mock_api_tests/test_client_namespace.py +0 -32
- package/generator/test/azure/mock_api_tests/test_client_naming.py +0 -57
- package/generator/test/azure/mock_api_tests/test_client_naming_enum_conflict.py +0 -35
- package/generator/test/azure/mock_api_tests/test_client_overload.py +0 -25
- package/generator/test/azure/mock_api_tests/test_client_structure.py +0 -60
- package/generator/test/azure/mock_api_tests/test_client_structure_clientoperationgroup.py +0 -29
- package/generator/test/azure/mock_api_tests/test_encode_duration.py +0 -60
- package/generator/test/azure/mock_api_tests/test_encode_numeric.py +0 -31
- package/generator/test/azure/mock_api_tests/test_model_base_flatten_compatibility.py +0 -251
- package/generator/test/azure/mock_api_tests/test_parameters_basic.py +0 -22
- package/generator/test/azure/mock_api_tests/test_parameters_spread.py +0 -66
- package/generator/test/azure/mock_api_tests/test_payload_content_negotiation.py +0 -33
- package/generator/test/azure/mock_api_tests/test_payload_multipart.py +0 -198
- package/generator/test/azure/mock_api_tests/test_resiliency_srv_driven.py +0 -124
- package/generator/test/azure/mock_api_tests/test_serialization_encoded_name_json.py +0 -21
- package/generator/test/azure/mock_api_tests/test_service_multi_service.py +0 -29
- package/generator/test/azure/mock_api_tests/test_special_words.py +0 -63
- package/generator/test/azure/requirements.txt +0 -125
- package/generator/test/azure/tox.ini +0 -64
- package/generator/test/data/image.jpg +0 -0
- package/generator/test/data/image.png +0 -0
- package/generator/test/dev_requirements.txt +0 -8
- package/generator/test/generic_mock_api_tests/asynctests/test_authentication_async.py +0 -140
- package/generator/test/generic_mock_api_tests/asynctests/test_encode_array_async.py +0 -139
- package/generator/test/generic_mock_api_tests/asynctests/test_encode_bytes_async.py +0 -132
- package/generator/test/generic_mock_api_tests/asynctests/test_encode_datetime_async.py +0 -127
- package/generator/test/generic_mock_api_tests/asynctests/test_headasboolean_async.py +0 -35
- package/generator/test/generic_mock_api_tests/asynctests/test_parameters_body_optionality_async.py +0 -30
- package/generator/test/generic_mock_api_tests/asynctests/test_parameters_collection_format_async.py +0 -38
- package/generator/test/generic_mock_api_tests/asynctests/test_parameters_path_async.py +0 -24
- package/generator/test/generic_mock_api_tests/asynctests/test_parameters_query_async.py +0 -18
- package/generator/test/generic_mock_api_tests/asynctests/test_payload_json_merge_patch_async.py +0 -98
- package/generator/test/generic_mock_api_tests/asynctests/test_payload_media_type_async.py +0 -27
- package/generator/test/generic_mock_api_tests/asynctests/test_payload_pageable_async.py +0 -134
- package/generator/test/generic_mock_api_tests/asynctests/test_payload_xml_async.py +0 -150
- package/generator/test/generic_mock_api_tests/asynctests/test_response_status_code_range_async.py +0 -38
- package/generator/test/generic_mock_api_tests/asynctests/test_routes_async.py +0 -331
- package/generator/test/generic_mock_api_tests/asynctests/test_server_endpoint_not_defined_async.py +0 -18
- package/generator/test/generic_mock_api_tests/asynctests/test_server_path_multiple_async.py +0 -25
- package/generator/test/generic_mock_api_tests/asynctests/test_server_path_single_async.py +0 -18
- package/generator/test/generic_mock_api_tests/asynctests/test_server_versions_not_versioned_async.py +0 -28
- package/generator/test/generic_mock_api_tests/asynctests/test_server_versions_versioned_async.py +0 -34
- package/generator/test/generic_mock_api_tests/asynctests/test_special_headers_conditional_request_async.py +0 -38
- package/generator/test/generic_mock_api_tests/asynctests/test_special_headers_repeatability_async.py +0 -19
- package/generator/test/generic_mock_api_tests/asynctests/test_specs_documentation_async.py +0 -59
- package/generator/test/generic_mock_api_tests/asynctests/test_streaming_jsonl_async.py +0 -27
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_array_async.py +0 -127
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_dictionary_async.py +0 -98
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_enum_extensible_async.py +0 -25
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_enum_fixed_async.py +0 -27
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_file_async.py +0 -59
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_empty_async.py +0 -32
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_inheritance_enum_discriminator_async.py +0 -70
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_inheritance_nested_discriminator_async.py +0 -85
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_inheritance_not_discriminated_async.py +0 -34
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_inheritance_recursive_async.py +0 -34
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_inheritance_single_discriminator_async.py +0 -67
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_usage_async.py +0 -32
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_model_visibility_async.py +0 -47
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_property_additionalproperties_async.py +0 -353
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_property_nullable_async.py +0 -110
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_property_optional_async.py +0 -197
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_property_valuetypes_async.py +0 -315
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_scalar_async.py +0 -60
- package/generator/test/generic_mock_api_tests/asynctests/test_typetest_union_async.py +0 -90
- package/generator/test/generic_mock_api_tests/asynctests/test_versioning_added_async.py +0 -36
- package/generator/test/generic_mock_api_tests/asynctests/test_versioning_made_optional_async.py +0 -21
- package/generator/test/generic_mock_api_tests/asynctests/test_versioning_removed_async.py +0 -39
- package/generator/test/generic_mock_api_tests/asynctests/test_versioning_renamed_from_async.py +0 -29
- package/generator/test/generic_mock_api_tests/asynctests/test_versioning_return_type_changed_from_async.py +0 -18
- package/generator/test/generic_mock_api_tests/asynctests/test_versioning_type_changed_from_async.py +0 -22
- package/generator/test/generic_mock_api_tests/conftest.py +0 -75
- package/generator/test/generic_mock_api_tests/data/image.jpg +0 -0
- package/generator/test/generic_mock_api_tests/data/image.png +0 -0
- package/generator/test/generic_mock_api_tests/test_authentication.py +0 -130
- package/generator/test/generic_mock_api_tests/test_encode_array.py +0 -126
- package/generator/test/generic_mock_api_tests/test_encode_bytes.py +0 -128
- package/generator/test/generic_mock_api_tests/test_encode_datetime.py +0 -123
- package/generator/test/generic_mock_api_tests/test_headasboolean.py +0 -33
- package/generator/test/generic_mock_api_tests/test_parameters_body_optionality.py +0 -27
- package/generator/test/generic_mock_api_tests/test_parameters_collection_format.py +0 -33
- package/generator/test/generic_mock_api_tests/test_parameters_path.py +0 -22
- package/generator/test/generic_mock_api_tests/test_parameters_query.py +0 -17
- package/generator/test/generic_mock_api_tests/test_payload_json_merge_patch.py +0 -93
- package/generator/test/generic_mock_api_tests/test_payload_media_type.py +0 -25
- package/generator/test/generic_mock_api_tests/test_payload_pageable.py +0 -99
- package/generator/test/generic_mock_api_tests/test_payload_xml.py +0 -135
- package/generator/test/generic_mock_api_tests/test_response_status_code_range.py +0 -36
- package/generator/test/generic_mock_api_tests/test_routes.py +0 -285
- package/generator/test/generic_mock_api_tests/test_server_endpoint_not_defined.py +0 -17
- package/generator/test/generic_mock_api_tests/test_server_path_multiple.py +0 -21
- package/generator/test/generic_mock_api_tests/test_server_path_single.py +0 -17
- package/generator/test/generic_mock_api_tests/test_server_versions_not_versioned.py +0 -25
- package/generator/test/generic_mock_api_tests/test_server_versions_versioned.py +0 -30
- package/generator/test/generic_mock_api_tests/test_special_headers_conditional_request.py +0 -34
- package/generator/test/generic_mock_api_tests/test_special_headers_repeatability.py +0 -18
- package/generator/test/generic_mock_api_tests/test_specs_documentation.py +0 -51
- package/generator/test/generic_mock_api_tests/test_streaming_jsonl.py +0 -25
- package/generator/test/generic_mock_api_tests/test_typetest_array.py +0 -111
- package/generator/test/generic_mock_api_tests/test_typetest_dictionary.py +0 -86
- package/generator/test/generic_mock_api_tests/test_typetest_enum_extensible.py +0 -23
- package/generator/test/generic_mock_api_tests/test_typetest_enum_fixed.py +0 -25
- package/generator/test/generic_mock_api_tests/test_typetest_file.py +0 -52
- package/generator/test/generic_mock_api_tests/test_typetest_model_empty.py +0 -29
- package/generator/test/generic_mock_api_tests/test_typetest_model_inheritance_enum_discriminator.py +0 -58
- package/generator/test/generic_mock_api_tests/test_typetest_model_inheritance_nested_discriminator.py +0 -79
- package/generator/test/generic_mock_api_tests/test_typetest_model_inheritance_not_discriminated.py +0 -31
- package/generator/test/generic_mock_api_tests/test_typetest_model_inheritance_recursive.py +0 -32
- package/generator/test/generic_mock_api_tests/test_typetest_model_inheritance_single_discriminator.py +0 -60
- package/generator/test/generic_mock_api_tests/test_typetest_model_usage.py +0 -28
- package/generator/test/generic_mock_api_tests/test_typetest_model_visibility.py +0 -40
- package/generator/test/generic_mock_api_tests/test_typetest_property_additionalproperties.py +0 -314
- package/generator/test/generic_mock_api_tests/test_typetest_property_nullable.py +0 -102
- package/generator/test/generic_mock_api_tests/test_typetest_property_optional.py +0 -174
- package/generator/test/generic_mock_api_tests/test_typetest_property_valuetypes.py +0 -286
- package/generator/test/generic_mock_api_tests/test_typetest_scalar.py +0 -53
- package/generator/test/generic_mock_api_tests/test_typetest_union.py +0 -80
- package/generator/test/generic_mock_api_tests/test_typetest_union_discriminated.py +0 -290
- package/generator/test/generic_mock_api_tests/test_versioning_added.py +0 -33
- package/generator/test/generic_mock_api_tests/test_versioning_made_optional.py +0 -20
- package/generator/test/generic_mock_api_tests/test_versioning_removed.py +0 -37
- package/generator/test/generic_mock_api_tests/test_versioning_renamed_from.py +0 -27
- package/generator/test/generic_mock_api_tests/test_versioning_return_type_changed_from.py +0 -17
- package/generator/test/generic_mock_api_tests/test_versioning_type_changed_from.py +0 -21
- package/generator/test/unbranded/mock_api_tests/asynctests/test_auth_flow_async.py +0 -19
- package/generator/test/unbranded/mock_api_tests/asynctests/test_encode_duration_async.py +0 -63
- package/generator/test/unbranded/mock_api_tests/asynctests/test_encode_numeric_async.py +0 -35
- package/generator/test/unbranded/mock_api_tests/asynctests/test_parameters_basic_async.py +0 -24
- package/generator/test/unbranded/mock_api_tests/asynctests/test_parameters_spread_async.py +0 -76
- package/generator/test/unbranded/mock_api_tests/asynctests/test_payload_content_negotiation_async.py +0 -37
- package/generator/test/unbranded/mock_api_tests/asynctests/test_payload_multipart_async.py +0 -218
- package/generator/test/unbranded/mock_api_tests/asynctests/test_serialization_encoded_name_json_async.py +0 -24
- package/generator/test/unbranded/mock_api_tests/asynctests/test_special_words_async.py +0 -73
- package/generator/test/unbranded/mock_api_tests/asynctests/test_unbranded_async.py +0 -24
- package/generator/test/unbranded/mock_api_tests/conftest.py +0 -91
- package/generator/test/unbranded/mock_api_tests/data/image.jpg +0 -0
- package/generator/test/unbranded/mock_api_tests/data/image.png +0 -0
- package/generator/test/unbranded/mock_api_tests/test_auth_flow.py +0 -17
- package/generator/test/unbranded/mock_api_tests/test_encode_duration.py +0 -60
- package/generator/test/unbranded/mock_api_tests/test_encode_numeric.py +0 -32
- package/generator/test/unbranded/mock_api_tests/test_parameters_basic.py +0 -22
- package/generator/test/unbranded/mock_api_tests/test_parameters_spread.py +0 -66
- package/generator/test/unbranded/mock_api_tests/test_payload_content_negotiation.py +0 -33
- package/generator/test/unbranded/mock_api_tests/test_payload_multipart.py +0 -200
- package/generator/test/unbranded/mock_api_tests/test_serialization_encoded_name_json.py +0 -22
- package/generator/test/unbranded/mock_api_tests/test_special_words.py +0 -66
- package/generator/test/unbranded/mock_api_tests/test_unbranded.py +0 -65
- package/generator/test/unbranded/requirements.txt +0 -69
- package/generator/test/unbranded/tox.ini +0 -64
- package/generator/test/unittests/conftest.py +0 -15
- package/generator/test/unittests/requirements.txt +0 -3
- package/generator/test/unittests/test_enums.py +0 -89
- package/generator/test/unittests/test_model_base_serialization.py +0 -4906
- package/generator/test/unittests/test_model_base_xml_serialization.py +0 -1239
- package/generator/test/unittests/test_name_converter.py +0 -35
- package/generator/test/unittests/test_optional_return_type.py +0 -268
- package/generator/test/unittests/test_parameter_ordering.py +0 -104
- package/generator/test/unittests/test_sort_schema.py +0 -93
- package/generator/test/unittests/tox.ini +0 -5
- /package/eng/scripts/ci/{mypy.ini → config/mypy.ini} +0 -0
- /package/eng/scripts/ci/{pylintrc → config/pylintrc} +0 -0
- /package/eng/scripts/ci/{pyproject.toml → config/pyproject.toml} +0 -0
- /package/eng/scripts/ci/{pyrightconfig.json → config/pyrightconfig.json} +0 -0
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from typetest.discriminatedunion import DiscriminatedClient
|
|
8
|
-
from typetest.discriminatedunion import models
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def client():
|
|
13
|
-
with DiscriminatedClient() as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@pytest.fixture
|
|
18
|
-
def cat_body():
|
|
19
|
-
"""Cat model for testing."""
|
|
20
|
-
return models.Cat(name="Whiskers", meow=True)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@pytest.fixture
|
|
24
|
-
def dog_body():
|
|
25
|
-
"""Dog model for testing."""
|
|
26
|
-
return models.Dog(name="Rex", bark=False)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# Tests for No Envelope / Default (inline discriminator with "kind")
|
|
30
|
-
@pytest.mark.skip(reason="After completely support discriminated unions, enable these tests")
|
|
31
|
-
class TestNoEnvelopeDefault:
|
|
32
|
-
"""Test discriminated union with inline discriminator (no envelope)."""
|
|
33
|
-
|
|
34
|
-
def test_get_default_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
35
|
-
"""Test getting cat with default (no query param or kind=cat).
|
|
36
|
-
|
|
37
|
-
Expected response:
|
|
38
|
-
{
|
|
39
|
-
"kind": "cat",
|
|
40
|
-
"name": "Whiskers",
|
|
41
|
-
"meow": true
|
|
42
|
-
}
|
|
43
|
-
"""
|
|
44
|
-
result = client.no_envelope.default.get()
|
|
45
|
-
assert result == cat_body
|
|
46
|
-
assert isinstance(result, models.Cat)
|
|
47
|
-
|
|
48
|
-
def test_get_with_kind_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
49
|
-
"""Test getting cat with kind=cat query parameter.
|
|
50
|
-
|
|
51
|
-
Expected response:
|
|
52
|
-
{
|
|
53
|
-
"kind": "cat",
|
|
54
|
-
"name": "Whiskers",
|
|
55
|
-
"meow": true
|
|
56
|
-
}
|
|
57
|
-
"""
|
|
58
|
-
result = client.no_envelope.default.get(kind="cat")
|
|
59
|
-
assert result == cat_body
|
|
60
|
-
assert isinstance(result, models.Cat)
|
|
61
|
-
|
|
62
|
-
def test_get_with_kind_dog(self, client: DiscriminatedClient, dog_body: models.Dog):
|
|
63
|
-
"""Test getting dog with kind=dog query parameter.
|
|
64
|
-
|
|
65
|
-
Expected response:
|
|
66
|
-
{
|
|
67
|
-
"kind": "dog",
|
|
68
|
-
"name": "Rex",
|
|
69
|
-
"bark": false
|
|
70
|
-
}
|
|
71
|
-
"""
|
|
72
|
-
result = client.no_envelope.default.get(kind="dog")
|
|
73
|
-
assert result == dog_body
|
|
74
|
-
assert isinstance(result, models.Dog)
|
|
75
|
-
|
|
76
|
-
def test_put_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
77
|
-
"""Test sending cat with inline discriminator.
|
|
78
|
-
|
|
79
|
-
Expected request:
|
|
80
|
-
{
|
|
81
|
-
"kind": "cat",
|
|
82
|
-
"name": "Whiskers",
|
|
83
|
-
"meow": true
|
|
84
|
-
}
|
|
85
|
-
"""
|
|
86
|
-
result = client.no_envelope.default.put(cat_body)
|
|
87
|
-
assert result == cat_body
|
|
88
|
-
assert isinstance(result, models.Cat)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
# Tests for No Envelope / Custom Discriminator (inline with custom "type" property)
|
|
92
|
-
@pytest.mark.skip(reason="After completely support discriminated unions, enable these tests")
|
|
93
|
-
class TestNoEnvelopeCustomDiscriminator:
|
|
94
|
-
"""Test discriminated union with inline discriminator and custom discriminator property name."""
|
|
95
|
-
|
|
96
|
-
def test_get_default_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
97
|
-
"""Test getting cat with default (no query param or type=cat).
|
|
98
|
-
|
|
99
|
-
Expected response:
|
|
100
|
-
{
|
|
101
|
-
"type": "cat",
|
|
102
|
-
"name": "Whiskers",
|
|
103
|
-
"meow": true
|
|
104
|
-
}
|
|
105
|
-
"""
|
|
106
|
-
result = client.no_envelope.custom_discriminator.get()
|
|
107
|
-
assert result == cat_body
|
|
108
|
-
assert isinstance(result, models.Cat)
|
|
109
|
-
|
|
110
|
-
def test_get_with_type_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
111
|
-
"""Test getting cat with type=cat query parameter.
|
|
112
|
-
|
|
113
|
-
Expected response:
|
|
114
|
-
{
|
|
115
|
-
"type": "cat",
|
|
116
|
-
"name": "Whiskers",
|
|
117
|
-
"meow": true
|
|
118
|
-
}
|
|
119
|
-
"""
|
|
120
|
-
result = client.no_envelope.custom_discriminator.get(type="cat")
|
|
121
|
-
assert result == cat_body
|
|
122
|
-
assert isinstance(result, models.Cat)
|
|
123
|
-
|
|
124
|
-
def test_get_with_type_dog(self, client: DiscriminatedClient, dog_body: models.Dog):
|
|
125
|
-
"""Test getting dog with type=dog query parameter.
|
|
126
|
-
|
|
127
|
-
Expected response:
|
|
128
|
-
{
|
|
129
|
-
"type": "dog",
|
|
130
|
-
"name": "Rex",
|
|
131
|
-
"bark": false
|
|
132
|
-
}
|
|
133
|
-
"""
|
|
134
|
-
result = client.no_envelope.custom_discriminator.get(type="dog")
|
|
135
|
-
assert result == dog_body
|
|
136
|
-
assert isinstance(result, models.Dog)
|
|
137
|
-
|
|
138
|
-
def test_put_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
139
|
-
"""Test sending cat with inline custom discriminator.
|
|
140
|
-
|
|
141
|
-
Expected request:
|
|
142
|
-
{
|
|
143
|
-
"type": "cat",
|
|
144
|
-
"name": "Whiskers",
|
|
145
|
-
"meow": true
|
|
146
|
-
}
|
|
147
|
-
"""
|
|
148
|
-
result = client.no_envelope.custom_discriminator.put(cat_body)
|
|
149
|
-
assert result == cat_body
|
|
150
|
-
assert isinstance(result, models.Cat)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
# Tests for Envelope / Object / Default (envelope with "kind" and "value")
|
|
154
|
-
@pytest.mark.skip(reason="After completely support discriminated unions, enable these tests")
|
|
155
|
-
class TestEnvelopeObjectDefault:
|
|
156
|
-
"""Test discriminated union with default envelope serialization."""
|
|
157
|
-
|
|
158
|
-
def test_get_default_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
159
|
-
"""Test getting cat with default (no query param or kind=cat).
|
|
160
|
-
|
|
161
|
-
Expected response:
|
|
162
|
-
{
|
|
163
|
-
"kind": "cat",
|
|
164
|
-
"value": {
|
|
165
|
-
"name": "Whiskers",
|
|
166
|
-
"meow": true
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
"""
|
|
170
|
-
result = client.envelope.object.default.get()
|
|
171
|
-
assert result == cat_body
|
|
172
|
-
assert isinstance(result, models.Cat)
|
|
173
|
-
|
|
174
|
-
def test_get_with_kind_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
175
|
-
"""Test getting cat with kind=cat query parameter.
|
|
176
|
-
|
|
177
|
-
Expected response:
|
|
178
|
-
{
|
|
179
|
-
"kind": "cat",
|
|
180
|
-
"value": {
|
|
181
|
-
"name": "Whiskers",
|
|
182
|
-
"meow": true
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
"""
|
|
186
|
-
result = client.envelope.object.default.get(kind="cat")
|
|
187
|
-
assert result == cat_body
|
|
188
|
-
assert isinstance(result, models.Cat)
|
|
189
|
-
|
|
190
|
-
def test_get_with_kind_dog(self, client: DiscriminatedClient, dog_body: models.Dog):
|
|
191
|
-
"""Test getting dog with kind=dog query parameter.
|
|
192
|
-
|
|
193
|
-
Expected response:
|
|
194
|
-
{
|
|
195
|
-
"kind": "dog",
|
|
196
|
-
"value": {
|
|
197
|
-
"name": "Rex",
|
|
198
|
-
"bark": false
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
"""
|
|
202
|
-
result = client.envelope.object.default.get(kind="dog")
|
|
203
|
-
assert result == dog_body
|
|
204
|
-
assert isinstance(result, models.Dog)
|
|
205
|
-
|
|
206
|
-
def test_put_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
207
|
-
"""Test sending cat with envelope serialization.
|
|
208
|
-
|
|
209
|
-
Expected request:
|
|
210
|
-
{
|
|
211
|
-
"kind": "cat",
|
|
212
|
-
"value": {
|
|
213
|
-
"name": "Whiskers",
|
|
214
|
-
"meow": true
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
"""
|
|
218
|
-
result = client.envelope.object.default.put(cat_body)
|
|
219
|
-
assert result == cat_body
|
|
220
|
-
assert isinstance(result, models.Cat)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
# Tests for Envelope / Object / Custom Properties (envelope with custom "petType" and "petData")
|
|
224
|
-
@pytest.mark.skip(reason="After completely support discriminated unions, enable these tests")
|
|
225
|
-
class TestEnvelopeObjectCustomProperties:
|
|
226
|
-
"""Test discriminated union with custom property names in envelope."""
|
|
227
|
-
|
|
228
|
-
def test_get_default_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
229
|
-
"""Test getting cat with default (no query param or petType=cat).
|
|
230
|
-
|
|
231
|
-
Expected response:
|
|
232
|
-
{
|
|
233
|
-
"petType": "cat",
|
|
234
|
-
"petData": {
|
|
235
|
-
"name": "Whiskers",
|
|
236
|
-
"meow": true
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
"""
|
|
240
|
-
result = client.envelope.object.custom_properties.get()
|
|
241
|
-
assert result == cat_body
|
|
242
|
-
assert isinstance(result, models.Cat)
|
|
243
|
-
|
|
244
|
-
def test_get_with_pet_type_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
245
|
-
"""Test getting cat with petType=cat query parameter.
|
|
246
|
-
|
|
247
|
-
Expected response:
|
|
248
|
-
{
|
|
249
|
-
"petType": "cat",
|
|
250
|
-
"petData": {
|
|
251
|
-
"name": "Whiskers",
|
|
252
|
-
"meow": true
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
"""
|
|
256
|
-
result = client.envelope.object.custom_properties.get(pet_type="cat")
|
|
257
|
-
assert result == cat_body
|
|
258
|
-
assert isinstance(result, models.Cat)
|
|
259
|
-
|
|
260
|
-
def test_get_with_pet_type_dog(self, client: DiscriminatedClient, dog_body: models.Dog):
|
|
261
|
-
"""Test getting dog with petType=dog query parameter.
|
|
262
|
-
|
|
263
|
-
Expected response:
|
|
264
|
-
{
|
|
265
|
-
"petType": "dog",
|
|
266
|
-
"petData": {
|
|
267
|
-
"name": "Rex",
|
|
268
|
-
"bark": false
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
"""
|
|
272
|
-
result = client.envelope.object.custom_properties.get(pet_type="dog")
|
|
273
|
-
assert result == dog_body
|
|
274
|
-
assert isinstance(result, models.Dog)
|
|
275
|
-
|
|
276
|
-
def test_put_cat(self, client: DiscriminatedClient, cat_body: models.Cat):
|
|
277
|
-
"""Test sending cat with custom property names in envelope.
|
|
278
|
-
|
|
279
|
-
Expected request:
|
|
280
|
-
{
|
|
281
|
-
"petType": "cat",
|
|
282
|
-
"petData": {
|
|
283
|
-
"name": "Whiskers",
|
|
284
|
-
"meow": true
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
"""
|
|
288
|
-
result = client.envelope.object.custom_properties.put(cat_body)
|
|
289
|
-
assert result == cat_body
|
|
290
|
-
assert isinstance(result, models.Cat)
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from versioning.added import AddedClient
|
|
8
|
-
from versioning.added.models import ModelV1, ModelV2, EnumV1, EnumV2
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def client():
|
|
13
|
-
with AddedClient(endpoint="http://localhost:3000", version="v2") as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test_v1(client: AddedClient):
|
|
18
|
-
assert client.v1(
|
|
19
|
-
ModelV1(prop="foo", enum_prop=EnumV1.ENUM_MEMBER_V2, union_prop=10),
|
|
20
|
-
header_v2="bar",
|
|
21
|
-
) == ModelV1(prop="foo", enum_prop=EnumV1.ENUM_MEMBER_V2, union_prop=10)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def test_v2(client: AddedClient):
|
|
25
|
-
assert client.v2(ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")) == ModelV2(
|
|
26
|
-
prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar"
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def test_interface_v2(client: AddedClient):
|
|
31
|
-
assert client.interface_v2.v2_in_interface(
|
|
32
|
-
ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
|
|
33
|
-
) == ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from versioning.madeoptional import MadeOptionalClient
|
|
8
|
-
from versioning.madeoptional.models import TestModel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def client():
|
|
13
|
-
with MadeOptionalClient(endpoint="http://localhost:3000", version="v2") as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test(client: MadeOptionalClient):
|
|
18
|
-
assert client.test(
|
|
19
|
-
TestModel(prop="foo"),
|
|
20
|
-
) == TestModel(prop="foo")
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from versioning.removed import RemovedClient
|
|
8
|
-
from versioning.removed.models import ModelV2, EnumV2, ModelV3, EnumV3
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def client():
|
|
13
|
-
with RemovedClient(endpoint="http://localhost:3000", version="v2") as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test_v2(client: RemovedClient):
|
|
18
|
-
assert client.v2(ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER_V2, union_prop="bar")) == ModelV2(
|
|
19
|
-
prop="foo", enum_prop=EnumV2.ENUM_MEMBER_V2, union_prop="bar"
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def test_model_v3():
|
|
24
|
-
client1 = RemovedClient(endpoint="http://localhost:3000", version="v1")
|
|
25
|
-
model1 = ModelV3(id="123", enum_prop=EnumV3.ENUM_MEMBER_V1)
|
|
26
|
-
result = client1.model_v3(model1)
|
|
27
|
-
assert result == model1
|
|
28
|
-
|
|
29
|
-
client2 = RemovedClient(endpoint="http://localhost:3000", version="v2preview")
|
|
30
|
-
model2 = ModelV3(id="123")
|
|
31
|
-
result = client2.model_v3(model2)
|
|
32
|
-
assert result == model2
|
|
33
|
-
|
|
34
|
-
client3 = RemovedClient(endpoint="http://localhost:3000", version="v2")
|
|
35
|
-
model3 = ModelV3(id="123", enum_prop=EnumV3.ENUM_MEMBER_V1)
|
|
36
|
-
result = client3.model_v3(model3)
|
|
37
|
-
assert result == model3
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from versioning.renamedfrom import RenamedFromClient
|
|
8
|
-
from versioning.renamedfrom.models import NewModel, NewEnum
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def client():
|
|
13
|
-
with RenamedFromClient(endpoint="http://localhost:3000", version="v2") as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test_new_op(client: RenamedFromClient):
|
|
18
|
-
assert client.new_op(
|
|
19
|
-
NewModel(new_prop="foo", enum_prop=NewEnum.NEW_ENUM_MEMBER, union_prop=10),
|
|
20
|
-
new_query="bar",
|
|
21
|
-
) == NewModel(new_prop="foo", enum_prop=NewEnum.NEW_ENUM_MEMBER, union_prop=10)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def test_new_interface_test(client: RenamedFromClient):
|
|
25
|
-
assert client.new_interface.new_op_in_new_interface(
|
|
26
|
-
NewModel(new_prop="foo", enum_prop=NewEnum.NEW_ENUM_MEMBER, union_prop=10)
|
|
27
|
-
) == NewModel(new_prop="foo", enum_prop=NewEnum.NEW_ENUM_MEMBER, union_prop=10)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from versioning.returntypechangedfrom import ReturnTypeChangedFromClient
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@pytest.fixture
|
|
11
|
-
def client():
|
|
12
|
-
with ReturnTypeChangedFromClient(endpoint="http://localhost:3000", version="v2") as client:
|
|
13
|
-
yield client
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def test(client: ReturnTypeChangedFromClient):
|
|
17
|
-
assert client.test("test") == "test"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from versioning.typechangedfrom import TypeChangedFromClient
|
|
8
|
-
from versioning.typechangedfrom.models import TestModel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def client():
|
|
13
|
-
with TypeChangedFromClient(endpoint="http://localhost:3000", version="v2") as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test(client: TypeChangedFromClient):
|
|
18
|
-
assert client.test(
|
|
19
|
-
TestModel(prop="foo", changed_prop="bar"),
|
|
20
|
-
param="baz",
|
|
21
|
-
) == TestModel(prop="foo", changed_prop="bar")
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from authentication.oauth2.aio import OAuth2Client
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@pytest.mark.asyncio
|
|
11
|
-
async def test_oauth2_auth_flows():
|
|
12
|
-
oauth2_client = OAuth2Client("fake_credential")
|
|
13
|
-
assert oauth2_client._config.authentication_policy._auth_flows == [
|
|
14
|
-
{
|
|
15
|
-
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
|
|
16
|
-
"scopes": [{"value": "https://security.microsoft.com/.default"}],
|
|
17
|
-
"type": "implicit",
|
|
18
|
-
}
|
|
19
|
-
]
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import datetime
|
|
7
|
-
|
|
8
|
-
import pytest
|
|
9
|
-
from encode.duration.aio import DurationClient
|
|
10
|
-
from encode.duration.property.models import (
|
|
11
|
-
Int32SecondsDurationProperty,
|
|
12
|
-
ISO8601DurationProperty,
|
|
13
|
-
FloatSecondsDurationProperty,
|
|
14
|
-
DefaultDurationProperty,
|
|
15
|
-
FloatSecondsDurationArrayProperty,
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@pytest.fixture
|
|
20
|
-
async def client():
|
|
21
|
-
async with DurationClient() as client:
|
|
22
|
-
yield client
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@pytest.mark.asyncio
|
|
26
|
-
async def test_query(client: DurationClient):
|
|
27
|
-
await client.query.default(input=datetime.timedelta(days=40))
|
|
28
|
-
await client.query.iso8601(input=datetime.timedelta(days=40))
|
|
29
|
-
await client.query.int32_seconds(input=36)
|
|
30
|
-
await client.query.int32_seconds_array(input=[36, 47])
|
|
31
|
-
await client.query.float_seconds(input=35.625)
|
|
32
|
-
await client.query.float64_seconds(input=35.625)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@pytest.mark.asyncio
|
|
36
|
-
async def test_property(client: DurationClient):
|
|
37
|
-
result = await client.property.default(DefaultDurationProperty(value=datetime.timedelta(days=40)))
|
|
38
|
-
assert result.value == datetime.timedelta(days=40)
|
|
39
|
-
result = await client.property.default(DefaultDurationProperty(value="P40D"))
|
|
40
|
-
assert result.value == datetime.timedelta(days=40)
|
|
41
|
-
result = await client.property.iso8601(ISO8601DurationProperty(value=datetime.timedelta(days=40)))
|
|
42
|
-
assert result.value == datetime.timedelta(days=40)
|
|
43
|
-
result = await client.property.iso8601(ISO8601DurationProperty(value="P40D"))
|
|
44
|
-
assert result.value == datetime.timedelta(days=40)
|
|
45
|
-
result = await client.property.int32_seconds(Int32SecondsDurationProperty(value=36))
|
|
46
|
-
assert result.value == 36
|
|
47
|
-
result = await client.property.float_seconds(FloatSecondsDurationProperty(value=35.625))
|
|
48
|
-
assert abs(result.value - 35.625) < 0.0001
|
|
49
|
-
result = await client.property.float64_seconds(FloatSecondsDurationProperty(value=35.625))
|
|
50
|
-
assert abs(result.value - 35.625) < 0.0001
|
|
51
|
-
result = await client.property.float_seconds_array(FloatSecondsDurationArrayProperty(value=[35.625, 46.75]))
|
|
52
|
-
assert abs(result.value[0] - 35.625) < 0.0001
|
|
53
|
-
assert abs(result.value[1] - 46.75) < 0.0001
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@pytest.mark.asyncio
|
|
57
|
-
async def test_header(client: DurationClient):
|
|
58
|
-
await client.header.default(duration=datetime.timedelta(days=40))
|
|
59
|
-
await client.header.iso8601(duration=datetime.timedelta(days=40))
|
|
60
|
-
await client.header.iso8601_array(duration=[datetime.timedelta(days=40), datetime.timedelta(days=50)])
|
|
61
|
-
await client.header.int32_seconds(duration=36)
|
|
62
|
-
await client.header.float_seconds(duration=35.625)
|
|
63
|
-
await client.header.float64_seconds(duration=35.625)
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from encode.numeric.aio import NumericClient
|
|
8
|
-
from encode.numeric.property import models
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
async def client():
|
|
13
|
-
async with NumericClient() as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@pytest.mark.asyncio
|
|
18
|
-
async def test_safeint_as_string(client: NumericClient):
|
|
19
|
-
result = await client.property.safeint_as_string(models.SafeintAsStringProperty(value=10000000000))
|
|
20
|
-
assert result.value == 10000000000
|
|
21
|
-
assert result["value"] == "10000000000"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@pytest.mark.asyncio
|
|
25
|
-
async def test_uint32_as_string_optional(client: NumericClient):
|
|
26
|
-
result = await client.property.uint32_as_string_optional(models.Uint32AsStringProperty(value=1))
|
|
27
|
-
assert result.value == 1
|
|
28
|
-
assert result["value"] == "1"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@pytest.mark.asyncio
|
|
32
|
-
async def test_uint8_as_string_optional(client: NumericClient):
|
|
33
|
-
result = await client.property.uint8_as_string(models.Uint32AsStringProperty(value=255))
|
|
34
|
-
assert result.value == 255
|
|
35
|
-
assert result["value"] == "255"
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from parameters.basic.aio import BasicClient
|
|
8
|
-
from parameters.basic.explicitbody.models import User
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
async def client():
|
|
13
|
-
async with BasicClient() as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@pytest.mark.asyncio
|
|
18
|
-
async def test_explicit_simple(client: BasicClient):
|
|
19
|
-
await client.explicit_body.simple(User(name="foo"))
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@pytest.mark.asyncio
|
|
23
|
-
async def test_implicit_simple(client: BasicClient):
|
|
24
|
-
await client.implicit_body.simple(name="foo")
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# -------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
# license information.
|
|
5
|
-
# --------------------------------------------------------------------------
|
|
6
|
-
import pytest
|
|
7
|
-
from parameters.spread.aio import SpreadClient
|
|
8
|
-
from parameters.spread.model.models import BodyParameter
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
async def client():
|
|
13
|
-
async with SpreadClient() as client:
|
|
14
|
-
yield client
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@pytest.mark.asyncio
|
|
18
|
-
async def test_model_body(client: SpreadClient):
|
|
19
|
-
await client.model.spread_as_request_body(name="foo")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@pytest.mark.asyncio
|
|
23
|
-
async def test_model_composite_request_only_with_body(client: SpreadClient):
|
|
24
|
-
await client.model.spread_composite_request_only_with_body(BodyParameter(name="foo"))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@pytest.mark.asyncio
|
|
28
|
-
async def test_model_composite_request_without_body(client: SpreadClient):
|
|
29
|
-
await client.model.spread_composite_request_without_body(name="foo", test_header="bar")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@pytest.mark.asyncio
|
|
33
|
-
async def test_model_composite_request(client: SpreadClient):
|
|
34
|
-
await client.model.spread_composite_request(name="foo", body=BodyParameter(name="foo"), test_header="bar")
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@pytest.mark.asyncio
|
|
38
|
-
async def test_model_composite_request_mix(client: SpreadClient):
|
|
39
|
-
await client.model.spread_composite_request_mix(name="foo", prop="foo", test_header="bar")
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@pytest.mark.asyncio
|
|
43
|
-
async def test_alias_body(client: SpreadClient):
|
|
44
|
-
await client.alias.spread_as_request_body(name="foo")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@pytest.mark.asyncio
|
|
48
|
-
async def test_alias_parameter(client: SpreadClient):
|
|
49
|
-
await client.alias.spread_as_request_parameter("1", x_ms_test_header="bar", name="foo")
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
@pytest.mark.asyncio
|
|
53
|
-
async def test_alias_multiple_parameter(client: SpreadClient):
|
|
54
|
-
await client.alias.spread_with_multiple_parameters(
|
|
55
|
-
"1",
|
|
56
|
-
x_ms_test_header="bar",
|
|
57
|
-
required_string="foo",
|
|
58
|
-
required_int_list=[1, 2],
|
|
59
|
-
optional_string_list=["foo", "bar"],
|
|
60
|
-
optional_int=1,
|
|
61
|
-
)
|
|
62
|
-
await client.alias.spread_with_multiple_parameters(
|
|
63
|
-
"1",
|
|
64
|
-
{"requiredString": "foo", "optionalInt": 1, "requiredIntList": [1, 2], "optionalStringList": ["foo", "bar"]},
|
|
65
|
-
x_ms_test_header="bar",
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@pytest.mark.asyncio
|
|
70
|
-
async def test_inner_model(client: SpreadClient):
|
|
71
|
-
await client.alias.spread_parameter_with_inner_model(id="1", x_ms_test_header="bar", body={"name": "foo"})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
@pytest.mark.asyncio
|
|
75
|
-
async def test_inner_alias(client: SpreadClient):
|
|
76
|
-
await client.alias.spread_parameter_with_inner_alias(id="1", x_ms_test_header="bar", body={"name": "foo", "age": 1})
|