Skip to content

Commit 7b5fc94

Browse files
chore(tests): improve enum examples (#81)
1 parent 62166e9 commit 7b5fc94

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

Diff for: tests/api_resources/environments/automations/tasks/test_executions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
7171
page_size=0,
7272
filter={
7373
"environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
74-
"phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"],
74+
"phases": ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"],
7575
"task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
7676
"task_references": ["string"],
7777
},
@@ -196,7 +196,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
196196
page_size=0,
197197
filter={
198198
"environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
199-
"phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"],
199+
"phases": ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"],
200200
"task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
201201
"task_references": ["string"],
202202
},

Diff for: tests/api_resources/environments/test_automations.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None:
4343
"image": "x",
4444
}
4545
},
46-
"triggered_by": ["manual"],
46+
"triggered_by": ["postDevcontainerStart"],
4747
}
4848
},
4949
"tasks": {
@@ -58,7 +58,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None:
5858
"image": "x",
5959
}
6060
},
61-
"triggered_by": ["manual"],
61+
"triggered_by": ["postEnvironmentStart"],
6262
}
6363
},
6464
},
@@ -118,7 +118,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) ->
118118
"image": "x",
119119
}
120120
},
121-
"triggered_by": ["manual"],
121+
"triggered_by": ["postDevcontainerStart"],
122122
}
123123
},
124124
"tasks": {
@@ -133,7 +133,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) ->
133133
"image": "x",
134134
}
135135
},
136-
"triggered_by": ["manual"],
136+
"triggered_by": ["postEnvironmentStart"],
137137
}
138138
},
139139
},

Diff for: tests/api_resources/projects/test_policies.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
3434
policy = client.projects.policies.create(
3535
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
3636
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
37-
role="PROJECT_ROLE_UNSPECIFIED",
37+
role="PROJECT_ROLE_ADMIN",
3838
)
3939
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
4040

@@ -72,7 +72,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
7272
policy = client.projects.policies.update(
7373
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
7474
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
75-
role="PROJECT_ROLE_UNSPECIFIED",
75+
role="PROJECT_ROLE_EDITOR",
7676
)
7777
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
7878

@@ -193,7 +193,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
193193
policy = await async_client.projects.policies.create(
194194
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
195195
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
196-
role="PROJECT_ROLE_UNSPECIFIED",
196+
role="PROJECT_ROLE_ADMIN",
197197
)
198198
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
199199

@@ -231,7 +231,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
231231
policy = await async_client.projects.policies.update(
232232
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
233233
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
234-
role="PROJECT_ROLE_UNSPECIFIED",
234+
role="PROJECT_ROLE_EDITOR",
235235
)
236236
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
237237

Diff for: tests/api_resources/runners/configurations/test_host_authentication_tokens.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
3838
host="github.com",
3939
refresh_token="ghr_xxxxxxxxxxxx",
4040
runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
41-
source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED",
41+
source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH",
4242
user_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
4343
)
4444
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) ->
240240
host="github.com",
241241
refresh_token="ghr_xxxxxxxxxxxx",
242242
runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
243-
source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED",
243+
source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH",
244244
user_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
245245
)
246246
assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"])

Diff for: tests/api_resources/runners/test_policies.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None:
3333
def test_method_create_with_all_params(self, client: Gitpod) -> None:
3434
policy = client.runners.policies.create(
3535
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
36-
role="RUNNER_ROLE_UNSPECIFIED",
36+
role="RUNNER_ROLE_ADMIN",
3737
runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
3838
)
3939
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
@@ -71,7 +71,7 @@ def test_method_update(self, client: Gitpod) -> None:
7171
def test_method_update_with_all_params(self, client: Gitpod) -> None:
7272
policy = client.runners.policies.update(
7373
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
74-
role="RUNNER_ROLE_UNSPECIFIED",
74+
role="RUNNER_ROLE_USER",
7575
runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
7676
)
7777
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
@@ -192,7 +192,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None:
192192
async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None:
193193
policy = await async_client.runners.policies.create(
194194
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
195-
role="RUNNER_ROLE_UNSPECIFIED",
195+
role="RUNNER_ROLE_ADMIN",
196196
runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
197197
)
198198
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
@@ -230,7 +230,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None:
230230
async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None:
231231
policy = await async_client.runners.policies.update(
232232
group_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
233-
role="RUNNER_ROLE_UNSPECIFIED",
233+
role="RUNNER_ROLE_USER",
234234
runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
235235
)
236236
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])

Diff for: tests/api_resources/test_events.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
3333
page_size=0,
3434
filter={
3535
"actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"],
36-
"actor_principals": ["PRINCIPAL_UNSPECIFIED"],
36+
"actor_principals": ["PRINCIPAL_USER"],
3737
"subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
3838
"subject_types": ["RESOURCE_TYPE_UNSPECIFIED"],
3939
},
@@ -120,7 +120,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
120120
page_size=0,
121121
filter={
122122
"actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"],
123-
"actor_principals": ["PRINCIPAL_UNSPECIFIED"],
123+
"actor_principals": ["PRINCIPAL_USER"],
124124
"subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
125125
"subject_types": ["RESOURCE_TYPE_UNSPECIFIED"],
126126
},

Diff for: tests/api_resources/test_organizations.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
163163
"token": "token",
164164
"page_size": 50,
165165
},
166-
scope="SCOPE_UNSPECIFIED",
166+
scope="SCOPE_ALL",
167167
)
168168
assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"])
169169

@@ -357,7 +357,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None:
357357
organization = client.organizations.set_role(
358358
organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
359359
user_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
360-
role="ORGANIZATION_ROLE_UNSPECIFIED",
360+
role="ORGANIZATION_ROLE_MEMBER",
361361
)
362362
assert_matches_type(object, organization, path=["response"])
363363

@@ -531,7 +531,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
531531
"token": "token",
532532
"page_size": 50,
533533
},
534-
scope="SCOPE_UNSPECIFIED",
534+
scope="SCOPE_ALL",
535535
)
536536
assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"])
537537

@@ -725,7 +725,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod)
725725
organization = await async_client.organizations.set_role(
726726
organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
727727
user_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
728-
role="ORGANIZATION_ROLE_UNSPECIFIED",
728+
role="ORGANIZATION_ROLE_MEMBER",
729729
)
730730
assert_matches_type(object, organization, path=["response"])
731731

Diff for: tests/api_resources/test_runners.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
3737
runner = client.runners.create(
3838
kind="RUNNER_KIND_UNSPECIFIED",
3939
name="Production Runner",
40-
provider="RUNNER_PROVIDER_UNSPECIFIED",
40+
provider="RUNNER_PROVIDER_AWS_EC2",
4141
spec={
4242
"configuration": {
4343
"auto_update": True,
4444
"region": "us-west",
45-
"release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED",
45+
"release_channel": "RUNNER_RELEASE_CHANNEL_STABLE",
4646
},
47-
"desired_phase": "RUNNER_PHASE_UNSPECIFIED",
47+
"desired_phase": "RUNNER_PHASE_ACTIVE",
4848
},
4949
)
5050
assert_matches_type(RunnerCreateResponse, runner, path=["response"])
@@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
122122
spec={
123123
"configuration": {
124124
"auto_update": True,
125-
"release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED",
125+
"release_channel": "RUNNER_RELEASE_CHANNEL_LATEST",
126126
},
127127
"desired_phase": "RUNNER_PHASE_UNSPECIFIED",
128128
},
@@ -166,7 +166,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
166166
filter={
167167
"creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
168168
"kinds": ["RUNNER_KIND_UNSPECIFIED"],
169-
"providers": ["RUNNER_PROVIDER_UNSPECIFIED"],
169+
"providers": ["RUNNER_PROVIDER_AWS_EC2"],
170170
},
171171
pagination={
172172
"token": "token",
@@ -360,14 +360,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
360360
runner = await async_client.runners.create(
361361
kind="RUNNER_KIND_UNSPECIFIED",
362362
name="Production Runner",
363-
provider="RUNNER_PROVIDER_UNSPECIFIED",
363+
provider="RUNNER_PROVIDER_AWS_EC2",
364364
spec={
365365
"configuration": {
366366
"auto_update": True,
367367
"region": "us-west",
368-
"release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED",
368+
"release_channel": "RUNNER_RELEASE_CHANNEL_STABLE",
369369
},
370-
"desired_phase": "RUNNER_PHASE_UNSPECIFIED",
370+
"desired_phase": "RUNNER_PHASE_ACTIVE",
371371
},
372372
)
373373
assert_matches_type(RunnerCreateResponse, runner, path=["response"])
@@ -445,7 +445,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
445445
spec={
446446
"configuration": {
447447
"auto_update": True,
448-
"release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED",
448+
"release_channel": "RUNNER_RELEASE_CHANNEL_LATEST",
449449
},
450450
"desired_phase": "RUNNER_PHASE_UNSPECIFIED",
451451
},
@@ -489,7 +489,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
489489
filter={
490490
"creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
491491
"kinds": ["RUNNER_KIND_UNSPECIFIED"],
492-
"providers": ["RUNNER_PROVIDER_UNSPECIFIED"],
492+
"providers": ["RUNNER_PROVIDER_AWS_EC2"],
493493
},
494494
pagination={
495495
"token": "token",

0 commit comments

Comments
 (0)