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
@@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None:
24
24
report = client .dns .analytics .reports .get (
25
25
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
26
26
)
27
- assert_matches_type (Report , report , path = ["response" ])
27
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
28
28
29
29
@pytest .mark .skip ()
30
30
@parametrize
@@ -39,7 +39,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
39
39
sort = "+responseCode,-queryName" ,
40
40
until = parse_datetime ("2023-11-11T13:00:00Z" ),
41
41
)
42
- assert_matches_type (Report , report , path = ["response" ])
42
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
43
43
44
44
@pytest .mark .skip ()
45
45
@parametrize
@@ -51,7 +51,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
51
51
assert response .is_closed is True
52
52
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
53
53
report = response .parse ()
54
- assert_matches_type (Report , report , path = ["response" ])
54
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
55
55
56
56
@pytest .mark .skip ()
57
57
@parametrize
@@ -63,7 +63,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
63
63
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
64
64
65
65
report = response .parse ()
66
- assert_matches_type (Report , report , path = ["response" ])
66
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
67
67
68
68
assert cast (Any , response .is_closed ) is True
69
69
@@ -85,7 +85,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
85
85
report = await async_client .dns .analytics .reports .get (
86
86
zone_id = "023e105f4ecef8ad9ca31a8372d0c353" ,
87
87
)
88
- assert_matches_type (Report , report , path = ["response" ])
88
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
89
89
90
90
@pytest .mark .skip ()
91
91
@parametrize
@@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
100
100
sort = "+responseCode,-queryName" ,
101
101
until = parse_datetime ("2023-11-11T13:00:00Z" ),
102
102
)
103
- assert_matches_type (Report , report , path = ["response" ])
103
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
104
104
105
105
@pytest .mark .skip ()
106
106
@parametrize
@@ -112,7 +112,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
112
112
assert response .is_closed is True
113
113
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
114
114
report = await response .parse ()
115
- assert_matches_type (Report , report , path = ["response" ])
115
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
116
116
117
117
@pytest .mark .skip ()
118
118
@parametrize
@@ -124,7 +124,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
124
124
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
125
125
126
126
report = await response .parse ()
127
- assert_matches_type (Report , report , path = ["response" ])
127
+ assert_matches_type (Optional [ Report ] , report , path = ["response" ])
128
128
129
129
assert cast (Any , response .is_closed ) is True
130
130
0 commit comments