3
3
from __future__ import annotations
4
4
5
5
import os
6
- from typing import Any , cast
6
+ from typing import Any , Optional , cast
7
7
8
8
import pytest
9
9
@@ -23,7 +23,7 @@ def test_method_trigger(self, client: Cloudflare) -> None:
23
23
activation_check = client .zones .activation_check .trigger (
24
24
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
25
25
)
26
- assert_matches_type (ActivationCheckTriggerResponse , activation_check , path = ["response" ])
26
+ assert_matches_type (Optional [ ActivationCheckTriggerResponse ] , activation_check , path = ["response" ])
27
27
28
28
@pytest .mark .skip ()
29
29
@parametrize
@@ -35,7 +35,7 @@ def test_raw_response_trigger(self, client: Cloudflare) -> None:
35
35
assert response .is_closed is True
36
36
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
37
37
activation_check = response .parse ()
38
- assert_matches_type (ActivationCheckTriggerResponse , activation_check , path = ["response" ])
38
+ assert_matches_type (Optional [ ActivationCheckTriggerResponse ] , activation_check , path = ["response" ])
39
39
40
40
@pytest .mark .skip ()
41
41
@parametrize
@@ -47,7 +47,7 @@ def test_streaming_response_trigger(self, client: Cloudflare) -> None:
47
47
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
48
48
49
49
activation_check = response .parse ()
50
- assert_matches_type (ActivationCheckTriggerResponse , activation_check , path = ["response" ])
50
+ assert_matches_type (Optional [ ActivationCheckTriggerResponse ] , activation_check , path = ["response" ])
51
51
52
52
assert cast (Any , response .is_closed ) is True
53
53
@@ -69,7 +69,7 @@ async def test_method_trigger(self, async_client: AsyncCloudflare) -> None:
69
69
activation_check = await async_client .zones .activation_check .trigger (
70
70
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
71
71
)
72
- assert_matches_type (ActivationCheckTriggerResponse , activation_check , path = ["response" ])
72
+ assert_matches_type (Optional [ ActivationCheckTriggerResponse ] , activation_check , path = ["response" ])
73
73
74
74
@pytest .mark .skip ()
75
75
@parametrize
@@ -81,7 +81,7 @@ async def test_raw_response_trigger(self, async_client: AsyncCloudflare) -> None
81
81
assert response .is_closed is True
82
82
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
83
83
activation_check = await response .parse ()
84
- assert_matches_type (ActivationCheckTriggerResponse , activation_check , path = ["response" ])
84
+ assert_matches_type (Optional [ ActivationCheckTriggerResponse ] , activation_check , path = ["response" ])
85
85
86
86
@pytest .mark .skip ()
87
87
@parametrize
@@ -93,7 +93,7 @@ async def test_streaming_response_trigger(self, async_client: AsyncCloudflare) -
93
93
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
94
94
95
95
activation_check = await response .parse ()
96
- assert_matches_type (ActivationCheckTriggerResponse , activation_check , path = ["response" ])
96
+ assert_matches_type (Optional [ ActivationCheckTriggerResponse ] , activation_check , path = ["response" ])
97
97
98
98
assert cast (Any , response .is_closed ) is True
99
99
0 commit comments