Skip to content

Commit 44d9b44

Browse files
chore(tests): improve enum examples (#2632)
1 parent fd5011f commit 44d9b44

File tree

107 files changed

+1120
-1120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1120
-1120
lines changed

tests/api_resources/accounts/logs/test_audit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
4545
actor_ip_address="17.168.228.63",
4646
actor_token_id="144cdb2e39c55e203cf225d8d8208647",
4747
actor_token_name="Test Token",
48-
actor_type="cloudflare_admin",
48+
actor_type="account",
4949
audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db",
5050
cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==",
5151
direction="desc",
@@ -133,7 +133,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
133133
actor_ip_address="17.168.228.63",
134134
actor_token_id="144cdb2e39c55e203cf225d8d8208647",
135135
actor_token_name="Test Token",
136-
actor_type="cloudflare_admin",
136+
actor_type="account",
137137
audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db",
138138
cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==",
139139
direction="desc",

tests/api_resources/accounts/test_members.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ def test_method_list(self, client: Cloudflare) -> None:
363363
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
364364
member = client.accounts.members.list(
365365
account_id="eb78d65290b24279ba6f44721b3ea3c4",
366-
direction="asc",
367-
order="user.first_name",
366+
direction="desc",
367+
order="status",
368368
page=1,
369369
per_page=5,
370370
status="accepted",
@@ -852,8 +852,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
852852
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
853853
member = await async_client.accounts.members.list(
854854
account_id="eb78d65290b24279ba6f44721b3ea3c4",
855-
direction="asc",
856-
order="user.first_name",
855+
direction="desc",
856+
order="status",
857857
page=1,
858858
per_page=5,
859859
status="accepted",

tests/api_resources/accounts/test_subscriptions.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_method_create(self, client: Cloudflare) -> None:
3434
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3535
subscription = client.accounts.subscriptions.create(
3636
account_id="023e105f4ecef8ad9ca31a8372d0c353",
37-
frequency="weekly",
37+
frequency="monthly",
3838
rate_plan={
3939
"id": "free",
4040
"currency": "USD",
@@ -91,7 +91,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
9191
subscription = client.accounts.subscriptions.update(
9292
subscription_identifier="506e3185e9c882d175a2d0cb0093d9f2",
9393
account_id="023e105f4ecef8ad9ca31a8372d0c353",
94-
frequency="weekly",
94+
frequency="monthly",
9595
rate_plan={
9696
"id": "free",
9797
"currency": "USD",
@@ -249,7 +249,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
249249
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
250250
subscription = await async_client.accounts.subscriptions.create(
251251
account_id="023e105f4ecef8ad9ca31a8372d0c353",
252-
frequency="weekly",
252+
frequency="monthly",
253253
rate_plan={
254254
"id": "free",
255255
"currency": "USD",
@@ -306,7 +306,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
306306
subscription = await async_client.accounts.subscriptions.update(
307307
subscription_identifier="506e3185e9c882d175a2d0cb0093d9f2",
308308
account_id="023e105f4ecef8ad9ca31a8372d0c353",
309-
frequency="weekly",
309+
frequency="monthly",
310310
rate_plan={
311311
"id": "free",
312312
"currency": "USD",

tests/api_resources/accounts/test_tokens.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def test_method_list(self, client: Cloudflare) -> None:
348348
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
349349
token = client.accounts.tokens.list(
350350
account_id="eb78d65290b24279ba6f44721b3ea3c4",
351-
direction="asc",
351+
direction="desc",
352352
page=1,
353353
per_page=5,
354354
)
@@ -862,7 +862,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
862862
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
863863
token = await async_client.accounts.tokens.list(
864864
account_id="eb78d65290b24279ba6f44721b3ea3c4",
865-
direction="asc",
865+
direction="desc",
866866
page=1,
867867
per_page=5,
868868
)

tests/api_resources/alerting/test_policies.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TestPolicies:
3030
def test_method_create(self, client: Cloudflare) -> None:
3131
policy = client.alerting.policies.create(
3232
account_id="023e105f4ecef8ad9ca31a8372d0c353",
33-
alert_type="access_custom_certificate_expiration_type",
33+
alert_type="universal_ssl_event_type",
3434
enabled=True,
3535
mechanisms={},
3636
name="SSL Notification Event Policy",
@@ -44,7 +44,7 @@ def test_method_create(self, client: Cloudflare) -> None:
4444
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
4545
policy = client.alerting.policies.create(
4646
account_id="023e105f4ecef8ad9ca31a8372d0c353",
47-
alert_type="access_custom_certificate_expiration_type",
47+
alert_type="universal_ssl_event_type",
4848
enabled=True,
4949
mechanisms={
5050
"email": [{"id": "[email protected]"}],
@@ -108,7 +108,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
108108
def test_raw_response_create(self, client: Cloudflare) -> None:
109109
response = client.alerting.policies.with_raw_response.create(
110110
account_id="023e105f4ecef8ad9ca31a8372d0c353",
111-
alert_type="access_custom_certificate_expiration_type",
111+
alert_type="universal_ssl_event_type",
112112
enabled=True,
113113
mechanisms={},
114114
name="SSL Notification Event Policy",
@@ -126,7 +126,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
126126
def test_streaming_response_create(self, client: Cloudflare) -> None:
127127
with client.alerting.policies.with_streaming_response.create(
128128
account_id="023e105f4ecef8ad9ca31a8372d0c353",
129-
alert_type="access_custom_certificate_expiration_type",
129+
alert_type="universal_ssl_event_type",
130130
enabled=True,
131131
mechanisms={},
132132
name="SSL Notification Event Policy",
@@ -147,7 +147,7 @@ def test_path_params_create(self, client: Cloudflare) -> None:
147147
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
148148
client.alerting.policies.with_raw_response.create(
149149
account_id="",
150-
alert_type="access_custom_certificate_expiration_type",
150+
alert_type="universal_ssl_event_type",
151151
enabled=True,
152152
mechanisms={},
153153
name="SSL Notification Event Policy",
@@ -173,7 +173,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
173173
policy_id="0da2b59e-f118-439d-8097-bdfb215203c9",
174174
account_id="023e105f4ecef8ad9ca31a8372d0c353",
175175
alert_interval="30m",
176-
alert_type="access_custom_certificate_expiration_type",
176+
alert_type="universal_ssl_event_type",
177177
description="Something describing the policy.",
178178
enabled=True,
179179
filters={
@@ -435,7 +435,7 @@ class TestAsyncPolicies:
435435
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
436436
policy = await async_client.alerting.policies.create(
437437
account_id="023e105f4ecef8ad9ca31a8372d0c353",
438-
alert_type="access_custom_certificate_expiration_type",
438+
alert_type="universal_ssl_event_type",
439439
enabled=True,
440440
mechanisms={},
441441
name="SSL Notification Event Policy",
@@ -449,7 +449,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
449449
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
450450
policy = await async_client.alerting.policies.create(
451451
account_id="023e105f4ecef8ad9ca31a8372d0c353",
452-
alert_type="access_custom_certificate_expiration_type",
452+
alert_type="universal_ssl_event_type",
453453
enabled=True,
454454
mechanisms={
455455
"email": [{"id": "[email protected]"}],
@@ -513,7 +513,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
513513
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
514514
response = await async_client.alerting.policies.with_raw_response.create(
515515
account_id="023e105f4ecef8ad9ca31a8372d0c353",
516-
alert_type="access_custom_certificate_expiration_type",
516+
alert_type="universal_ssl_event_type",
517517
enabled=True,
518518
mechanisms={},
519519
name="SSL Notification Event Policy",
@@ -531,7 +531,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
531531
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
532532
async with async_client.alerting.policies.with_streaming_response.create(
533533
account_id="023e105f4ecef8ad9ca31a8372d0c353",
534-
alert_type="access_custom_certificate_expiration_type",
534+
alert_type="universal_ssl_event_type",
535535
enabled=True,
536536
mechanisms={},
537537
name="SSL Notification Event Policy",
@@ -552,7 +552,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
552552
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
553553
await async_client.alerting.policies.with_raw_response.create(
554554
account_id="",
555-
alert_type="access_custom_certificate_expiration_type",
555+
alert_type="universal_ssl_event_type",
556556
enabled=True,
557557
mechanisms={},
558558
name="SSL Notification Event Policy",
@@ -578,7 +578,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
578578
policy_id="0da2b59e-f118-439d-8097-bdfb215203c9",
579579
account_id="023e105f4ecef8ad9ca31a8372d0c353",
580580
alert_interval="30m",
581-
alert_type="access_custom_certificate_expiration_type",
581+
alert_type="universal_ssl_event_type",
582582
description="Something describing the policy.",
583583
enabled=True,
584584
filters={

tests/api_resources/api_gateway/discovery/test_operations.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
3434
operation = client.api_gateway.discovery.operations.list(
3535
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
3636
diff=True,
37-
direction="asc",
37+
direction="desc",
3838
endpoint="/api/v1",
3939
host=["api.cloudflare.com"],
4040
method=["GET"],
41-
order="host",
41+
order="method",
4242
origin="ML",
4343
page=1,
4444
per_page=5,
@@ -204,11 +204,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
204204
operation = await async_client.api_gateway.discovery.operations.list(
205205
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
206206
diff=True,
207-
direction="asc",
207+
direction="desc",
208208
endpoint="/api/v1",
209209
host=["api.cloudflare.com"],
210210
method=["GET"],
211-
order="host",
211+
order="method",
212212
origin="ML",
213213
page=1,
214214
per_page=5,

tests/api_resources/api_gateway/operations/test_schema_validation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
3434
schema_validation = client.api_gateway.operations.schema_validation.update(
3535
operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
3636
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
37-
mitigation_action="log",
37+
mitigation_action="block",
3838
)
3939
assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"])
4040

@@ -197,7 +197,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
197197
schema_validation = await async_client.api_gateway.operations.schema_validation.update(
198198
operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
199199
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
200-
mitigation_action="log",
200+
mitigation_action="block",
201201
)
202202
assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"])
203203

tests/api_resources/api_gateway/settings/test_schema_validation.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ class TestSchemaValidation:
2323
def test_method_update(self, client: Cloudflare) -> None:
2424
schema_validation = client.api_gateway.settings.schema_validation.update(
2525
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
26-
validation_default_mitigation_action="none",
26+
validation_default_mitigation_action="block",
2727
)
2828
assert_matches_type(Settings, schema_validation, path=["response"])
2929

3030
@parametrize
3131
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
3232
schema_validation = client.api_gateway.settings.schema_validation.update(
3333
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
34-
validation_default_mitigation_action="none",
34+
validation_default_mitigation_action="block",
3535
validation_override_mitigation_action="none",
3636
)
3737
assert_matches_type(Settings, schema_validation, path=["response"])
@@ -40,7 +40,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
4040
def test_raw_response_update(self, client: Cloudflare) -> None:
4141
response = client.api_gateway.settings.schema_validation.with_raw_response.update(
4242
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
43-
validation_default_mitigation_action="none",
43+
validation_default_mitigation_action="block",
4444
)
4545

4646
assert response.is_closed is True
@@ -52,7 +52,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
5252
def test_streaming_response_update(self, client: Cloudflare) -> None:
5353
with client.api_gateway.settings.schema_validation.with_streaming_response.update(
5454
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
55-
validation_default_mitigation_action="none",
55+
validation_default_mitigation_action="block",
5656
) as response:
5757
assert not response.is_closed
5858
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -67,7 +67,7 @@ def test_path_params_update(self, client: Cloudflare) -> None:
6767
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
6868
client.api_gateway.settings.schema_validation.with_raw_response.update(
6969
zone_id="",
70-
validation_default_mitigation_action="none",
70+
validation_default_mitigation_action="block",
7171
)
7272

7373
@parametrize
@@ -81,7 +81,7 @@ def test_method_edit(self, client: Cloudflare) -> None:
8181
def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
8282
schema_validation = client.api_gateway.settings.schema_validation.edit(
8383
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
84-
validation_default_mitigation_action="none",
84+
validation_default_mitigation_action="block",
8585
validation_override_mitigation_action="none",
8686
)
8787
assert_matches_type(Settings, schema_validation, path=["response"])
@@ -163,15 +163,15 @@ class TestAsyncSchemaValidation:
163163
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
164164
schema_validation = await async_client.api_gateway.settings.schema_validation.update(
165165
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
166-
validation_default_mitigation_action="none",
166+
validation_default_mitigation_action="block",
167167
)
168168
assert_matches_type(Settings, schema_validation, path=["response"])
169169

170170
@parametrize
171171
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
172172
schema_validation = await async_client.api_gateway.settings.schema_validation.update(
173173
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
174-
validation_default_mitigation_action="none",
174+
validation_default_mitigation_action="block",
175175
validation_override_mitigation_action="none",
176176
)
177177
assert_matches_type(Settings, schema_validation, path=["response"])
@@ -180,7 +180,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
180180
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
181181
response = await async_client.api_gateway.settings.schema_validation.with_raw_response.update(
182182
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
183-
validation_default_mitigation_action="none",
183+
validation_default_mitigation_action="block",
184184
)
185185

186186
assert response.is_closed is True
@@ -192,7 +192,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
192192
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
193193
async with async_client.api_gateway.settings.schema_validation.with_streaming_response.update(
194194
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
195-
validation_default_mitigation_action="none",
195+
validation_default_mitigation_action="block",
196196
) as response:
197197
assert not response.is_closed
198198
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -207,7 +207,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
207207
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
208208
await async_client.api_gateway.settings.schema_validation.with_raw_response.update(
209209
zone_id="",
210-
validation_default_mitigation_action="none",
210+
validation_default_mitigation_action="block",
211211
)
212212

213213
@parametrize
@@ -221,7 +221,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
221221
async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
222222
schema_validation = await async_client.api_gateway.settings.schema_validation.edit(
223223
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
224-
validation_default_mitigation_action="none",
224+
validation_default_mitigation_action="block",
225225
validation_override_mitigation_action="none",
226226
)
227227
assert_matches_type(Settings, schema_validation, path=["response"])

tests/api_resources/api_gateway/test_operations.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_method_list(self, client: Cloudflare) -> None:
8686
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
8787
operation = client.api_gateway.operations.list(
8888
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
89-
direction="asc",
89+
direction="desc",
9090
endpoint="/api/v1",
9191
feature=["thresholds"],
9292
host=["api.cloudflare.com"],
@@ -402,7 +402,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
402402
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
403403
operation = await async_client.api_gateway.operations.list(
404404
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
405-
direction="asc",
405+
direction="desc",
406406
endpoint="/api/v1",
407407
feature=["thresholds"],
408408
host=["api.cloudflare.com"],

0 commit comments

Comments
 (0)