Repository navigation
[python] Add mock_api tests for exact() client name - #10792
Merged
Merged
Conversation
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test case for pull 4430 and bump dependencies
[python] Add mock_api tests for May 26, 2026
exact() client name
Yuchao Yan (msyyc)
marked this pull request as ready for review
May 26, 2026 06:32
|
You can try these changes here
|
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
Yuchao Yan (msyyc)
enabled auto-merge
May 26, 2026 09:26
Chenxi Jiang (ChenxiJiang333)
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Covers the two new Spector scenarios from Azure/typespec-azure#4430, which verify that
exact()used with@clientNameskips language-specific casing transforms.Dependency bumps (
packages/http-client-python/package.json)@azure-tools/azure-http-specs:0.1.0-alpha.40→0.1.0-alpha.41-dev.1(first version containing theexact-namespec).@azure-tools/typespec-client-generator-coredevDep:~0.68.0→~0.68.2.Tests
Added sync + async mock_api tests under
tests/mock_api/azure/for theExactNameclient:test_model/test_property: round-trip thePOST /azure/client-generator-core/exact-name/{model,property}endpoints.test_model_class_name_preserved: asserts the generated model class isMy_model(notMyModel), confirmingexact("my_model")bypasses PascalCasing.test_property_name_preserved: assertsScopedModelexposes attribute_my_name, confirming the python-scopedexact("_my_name")retains the leading underscore.Note:
ScopedModel(_my_name=...)kwarg init is not supported because the generated model base filters underscore-prefixed names out of_attr_to_rest_field; tests use dict-form init instead. May be worth a follow-up on the emitter side.