From 25b1b5955ce05e7d1eda96c55dffc2d14237251e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:30:04 +0000 Subject: [PATCH] chore(tests): improve enum examples --- .../automations/tasks/test_executions.py | 4 ++-- .../environments/test_automations.py | 8 ++++---- tests/api_resources/projects/test_policies.py | 8 ++++---- .../test_host_authentication_tokens.py | 4 ++-- tests/api_resources/runners/test_policies.py | 8 ++++---- tests/api_resources/test_events.py | 4 ++-- tests/api_resources/test_organizations.py | 8 ++++---- tests/api_resources/test_runners.py | 20 +++++++++---------- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 722a618..1adffcc 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -71,7 +71,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"], + "phases": ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "task_references": ["string"], }, @@ -196,7 +196,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"], + "phases": ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "task_references": ["string"], }, diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 52ebff8..5d9cff1 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -43,7 +43,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postDevcontainerStart"], } }, "tasks": { @@ -58,7 +58,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postEnvironmentStart"], } }, }, @@ -118,7 +118,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postDevcontainerStart"], } }, "tasks": { @@ -133,7 +133,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postEnvironmentStart"], } }, }, diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index fdd40b7..ff81a48 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_ADMIN", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -72,7 +72,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_EDITOR", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -193,7 +193,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> policy = await async_client.projects.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_ADMIN", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -231,7 +231,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> policy = await async_client.projects.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_EDITOR", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 684e0f4..7667d3c 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: host="github.com", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", - source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -240,7 +240,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> host="github.com", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", - source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index a5da4a8..b94c9ff 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_ADMIN", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -71,7 +71,7 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_USER", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -192,7 +192,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_ADMIN", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -230,7 +230,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_USER", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 77b33af..fa926d8 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], - "actor_principals": ["PRINCIPAL_UNSPECIFIED"], + "actor_principals": ["PRINCIPAL_USER"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, @@ -120,7 +120,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], - "actor_principals": ["PRINCIPAL_UNSPECIFIED"], + "actor_principals": ["PRINCIPAL_USER"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 62a5503..7d24c5c 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -163,7 +163,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 50, }, - scope="SCOPE_UNSPECIFIED", + scope="SCOPE_ALL", ) assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) @@ -357,7 +357,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="ORGANIZATION_ROLE_UNSPECIFIED", + role="ORGANIZATION_ROLE_MEMBER", ) assert_matches_type(object, organization, path=["response"]) @@ -531,7 +531,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 50, }, - scope="SCOPE_UNSPECIFIED", + scope="SCOPE_ALL", ) assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) @@ -725,7 +725,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) organization = await async_client.organizations.set_role( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="ORGANIZATION_ROLE_UNSPECIFIED", + role="ORGANIZATION_ROLE_MEMBER", ) assert_matches_type(object, organization, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 8968127..45caf1c 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -37,14 +37,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", name="Production Runner", - provider="RUNNER_PROVIDER_UNSPECIFIED", + provider="RUNNER_PROVIDER_AWS_EC2", spec={ "configuration": { "auto_update": True, "region": "us-west", - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, - "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + "desired_phase": "RUNNER_PHASE_ACTIVE", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: spec={ "configuration": { "auto_update": True, - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, @@ -166,7 +166,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], - "providers": ["RUNNER_PROVIDER_UNSPECIFIED"], + "providers": ["RUNNER_PROVIDER_AWS_EC2"], }, pagination={ "token": "token", @@ -360,14 +360,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> runner = await async_client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", name="Production Runner", - provider="RUNNER_PROVIDER_UNSPECIFIED", + provider="RUNNER_PROVIDER_AWS_EC2", spec={ "configuration": { "auto_update": True, "region": "us-west", - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, - "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + "desired_phase": "RUNNER_PHASE_ACTIVE", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -445,7 +445,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> spec={ "configuration": { "auto_update": True, - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, @@ -489,7 +489,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], - "providers": ["RUNNER_PROVIDER_UNSPECIFIED"], + "providers": ["RUNNER_PROVIDER_AWS_EC2"], }, pagination={ "token": "token",