Add sync and async test cases for azure-resource-manager-method-subscription-id mock API tests#3205
Merged
Add sync and async test cases for azure-resource-manager-method-subscription-id mock API tests#3205
Conversation
…hensive test coverage Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test cases
Add test cases for azure-resource-manager-method-subscription-id mock API tests
Sep 11, 2025
msyyc
reviewed
Sep 11, 2025
...espec-python/test/azure/mock_api_tests/test_azure_resource_manager_method_subscription_id.py
Show resolved
Hide resolved
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
msyyc
reviewed
Sep 11, 2025
...espec-python/test/azure/mock_api_tests/test_azure_resource_manager_method_subscription_id.py
Show resolved
Hide resolved
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot
AI
changed the title
Add test cases for azure-resource-manager-method-subscription-id mock API tests
Add sync and async test cases for azure-resource-manager-method-subscription-id mock API tests
Sep 11, 2025
msyyc
approved these changes
Sep 12, 2025
github-merge-queue bot
pushed a commit
to microsoft/typespec
that referenced
this pull request
Sep 12, 2025
Add same test cases of Azure/autorest.python#3205
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.
This PR adds comprehensive test coverage for the
azure-resource-manager-method-subscription-idgenerated SDK by implementing both sync and async test files in the mock API tests folder, fixes the spelling errors detected by cspell, and formats the test files with black.Overview
The new test files provide complete coverage for all operations defined in the Azure Resource Manager Method Subscription ID specification, testing the unique behavior of method-level vs client-level subscription ID parameter placement.
Test Coverage
The implementation includes 13 test functions covering:
Operations Group
test_operations_list()- Validates the operations listing endpointTwoSubscriptionResourcesMethodLevel Group
Tests for resources where subscription ID is moved from client-level to method-level:
MixedSubscriptionPlacement Group
Tests mixed parameter placement scenarios:
Key Features
subscription_idas a method parameter rather than using the client-level parameterSubscriptionResource1,SubscriptionResource2,SubscriptionResource,ResourceGroupResource) with correct propertiesImplementation Details
The test files follow the established patterns from existing mock API tests:
MethodSubscriptionIdClientfromazure.resourcemanager.methodsubscriptionidMethodSubscriptionIdClientfromazure.resourcemanager.methodsubscriptionid.aiowith properasync/awaitpatternsCspell Fix
Added
methodsubscriptionidto the cspell.yaml words list to resolve spelling check errors in the test files.This ensures comprehensive validation of the method-level subscription ID parameter placement functionality in Azure Resource Manager operations for both sync and async clients.
Fixes #3204.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.