Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated tests should not suggest read-only in request #2978

Open
lmazuel opened this issue Dec 19, 2024 · 0 comments
Open

Generated tests should not suggest read-only in request #2978

lmazuel opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
mq This issue is part of a "milestone of quality" initiative.

Comments

@lmazuel
Copy link
Member

lmazuel commented Dec 19, 2024

See this field that is visibility("read"):
https://github.com/Azure/azure-rest-api-specs/blob/c9a4dc04527f7fdb4a944e2c392f2de280ef7cae/specification/durabletask/DurableTask.Management/main.tsp#L70

And the generated test for Python looks like this:

@recorded_by_proxy
    def test_schedulers_begin_update(self, resource_group):
        response = self.client.schedulers.begin_update(
            resource_group_name=resource_group.name,
            scheduler_name="str",
            properties={
                "location": "str",
                "id": "str",
                "name": "str",
                "properties": {
                    "ipAllowlist": ["str"],
                    "sku": {"name": "str", "capacity": 0, "redundancyState": "str"},
                    "endpoint": "str",
                    "provisioningState": "str",
                },
                "systemData": {
                    "createdAt": "2020-02-20 00:00:00",
                    "createdBy": "str",
                    "createdByType": "str",
                    "lastModifiedAt": "2020-02-20 00:00:00",
                    "lastModifiedBy": "str",
                    "lastModifiedByType": "str",
                },
                "tags": {"str": "str"},
                "type": "str",
            },
        ).result()  # call '.result()' to poll until service return final result

Note that we suggest redundancyState in the request. As this field is "read", it should not be suggested and should be ommmited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mq This issue is part of a "milestone of quality" initiative.
Projects
None yet
Development

No branches or pull requests

2 participants