Open msyyc opened 2 months ago
method-level should override client-level though, I'm not sure what this issue is opened for, can you clarify @msyyc? Thanks!
api_version is already client level signature, so there is no need to set it when call specific method. The expected generated test shall be like:
@recorded_by_proxy
def test_list(self, resource_group):
response = self.client.operations.list()
result = [r for r in response]
# please add some check logic here by yourself
# ...
We still have the ability on the method-level to override the api-version
, because let's say we initialize our client with an api-version that works for most methods, but for a specific method, we want to modify the api-version
, so this I believe can have method-level overrides
Of course python permit users to override api-version when call method. In test generation, we don't want to show it since users may copy the generated test to tests
folder for live test then it actually only test the specific api-version instead of default api-version if devs forget to update the test cases which brings some risks.
ah I see, ok that makes sense. Thanks for describing @msyyc!
"api-version" is usually client-level signature so no need to set it in specific: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/datafactory/azure-mgmt-datafactory/generated_tests/test_data_factory_management_operations.py#L25