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
@@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None:
25
25
method = "PUT" ,
26
26
url = "https://some.zone/some_path" ,
27
27
)
28
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
28
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
29
29
30
30
@pytest .mark .skip ()
31
31
@parametrize
@@ -67,7 +67,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
67
67
protocol = "HTTP/1.1" ,
68
68
skip_response = True ,
69
69
)
70
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
70
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
71
71
72
72
@pytest .mark .skip ()
73
73
@parametrize
@@ -81,7 +81,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
81
81
assert response .is_closed is True
82
82
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
83
83
trace = response .parse ()
84
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
84
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
85
85
86
86
@pytest .mark .skip ()
87
87
@parametrize
@@ -95,7 +95,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
95
95
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
96
96
97
97
trace = response .parse ()
98
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
98
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
99
99
100
100
assert cast (Any , response .is_closed ) is True
101
101
@@ -121,7 +121,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
121
121
method = "PUT" ,
122
122
url = "https://some.zone/some_path" ,
123
123
)
124
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
124
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
125
125
126
126
@pytest .mark .skip ()
127
127
@parametrize
@@ -163,7 +163,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
163
163
protocol = "HTTP/1.1" ,
164
164
skip_response = True ,
165
165
)
166
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
166
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
167
167
168
168
@pytest .mark .skip ()
169
169
@parametrize
@@ -177,7 +177,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
177
177
assert response .is_closed is True
178
178
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
179
179
trace = await response .parse ()
180
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
180
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
181
181
182
182
@pytest .mark .skip ()
183
183
@parametrize
@@ -191,7 +191,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
191
191
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
192
192
193
193
trace = await response .parse ()
194
- assert_matches_type (TraceCreateResponse , trace , path = ["response" ])
194
+ assert_matches_type (Optional [ TraceCreateResponse ] , trace , path = ["response" ])
195
195
196
196
assert cast (Any , response .is_closed ) is True
197
197
0 commit comments