1313from gcore .pagination import SyncOffsetPage , AsyncOffsetPage
1414from gcore .types .cloud import BillingReservation
1515
16+ # pyright: reportDeprecated=false
17+
1618base_url = os .environ .get ("TEST_API_BASE_URL" , "http://127.0.0.1:4010" )
1719
1820
@@ -21,30 +23,35 @@ class TestBillingReservations:
2123
2224 @parametrize
2325 def test_method_list (self , client : Gcore ) -> None :
24- billing_reservation = client .cloud .billing_reservations .list ()
26+ with pytest .warns (DeprecationWarning ):
27+ billing_reservation = client .cloud .billing_reservations .list ()
28+
2529 assert_matches_type (SyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
2630
2731 @parametrize
2832 def test_method_list_with_all_params (self , client : Gcore ) -> None :
29- billing_reservation = client .cloud .billing_reservations .list (
30- activated_from = parse_date ("2019-12-27" ),
31- activated_to = parse_date ("2019-12-27" ),
32- created_from = parse_datetime ("2019-12-27T18:11:19.117Z" ),
33- created_to = parse_datetime ("2019-12-27T18:11:19.117Z" ),
34- deactivated_from = parse_date ("2019-12-27" ),
35- deactivated_to = parse_date ("2019-12-27" ),
36- limit = 1 ,
37- metric_name = "metric_name" ,
38- offset = 0 ,
39- order_by = "active_from.asc" ,
40- region_id = 0 ,
41- status = ["ACTIVATED" ],
42- )
33+ with pytest .warns (DeprecationWarning ):
34+ billing_reservation = client .cloud .billing_reservations .list (
35+ activated_from = parse_date ("2019-12-27" ),
36+ activated_to = parse_date ("2019-12-27" ),
37+ created_from = parse_datetime ("2019-12-27T18:11:19.117Z" ),
38+ created_to = parse_datetime ("2019-12-27T18:11:19.117Z" ),
39+ deactivated_from = parse_date ("2019-12-27" ),
40+ deactivated_to = parse_date ("2019-12-27" ),
41+ limit = 1 ,
42+ metric_name = "metric_name" ,
43+ offset = 0 ,
44+ order_by = "active_from.asc" ,
45+ region_id = 0 ,
46+ status = ["ACTIVATED" ],
47+ )
48+
4349 assert_matches_type (SyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
4450
4551 @parametrize
4652 def test_raw_response_list (self , client : Gcore ) -> None :
47- response = client .cloud .billing_reservations .with_raw_response .list ()
53+ with pytest .warns (DeprecationWarning ):
54+ response = client .cloud .billing_reservations .with_raw_response .list ()
4855
4956 assert response .is_closed is True
5057 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -53,27 +60,31 @@ def test_raw_response_list(self, client: Gcore) -> None:
5360
5461 @parametrize
5562 def test_streaming_response_list (self , client : Gcore ) -> None :
56- with client .cloud .billing_reservations .with_streaming_response .list () as response :
57- assert not response .is_closed
58- assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
63+ with pytest .warns (DeprecationWarning ):
64+ with client .cloud .billing_reservations .with_streaming_response .list () as response :
65+ assert not response .is_closed
66+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
5967
60- billing_reservation = response .parse ()
61- assert_matches_type (SyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
68+ billing_reservation = response .parse ()
69+ assert_matches_type (SyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
6270
6371 assert cast (Any , response .is_closed ) is True
6472
6573 @parametrize
6674 def test_method_get (self , client : Gcore ) -> None :
67- billing_reservation = client .cloud .billing_reservations .get (
68- 0 ,
69- )
75+ with pytest .warns (DeprecationWarning ):
76+ billing_reservation = client .cloud .billing_reservations .get (
77+ 0 ,
78+ )
79+
7080 assert_matches_type (BillingReservation , billing_reservation , path = ["response" ])
7181
7282 @parametrize
7383 def test_raw_response_get (self , client : Gcore ) -> None :
74- response = client .cloud .billing_reservations .with_raw_response .get (
75- 0 ,
76- )
84+ with pytest .warns (DeprecationWarning ):
85+ response = client .cloud .billing_reservations .with_raw_response .get (
86+ 0 ,
87+ )
7788
7889 assert response .is_closed is True
7990 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -82,14 +93,15 @@ def test_raw_response_get(self, client: Gcore) -> None:
8293
8394 @parametrize
8495 def test_streaming_response_get (self , client : Gcore ) -> None :
85- with client .cloud .billing_reservations .with_streaming_response .get (
86- 0 ,
87- ) as response :
88- assert not response .is_closed
89- assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
96+ with pytest .warns (DeprecationWarning ):
97+ with client .cloud .billing_reservations .with_streaming_response .get (
98+ 0 ,
99+ ) as response :
100+ assert not response .is_closed
101+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
90102
91- billing_reservation = response .parse ()
92- assert_matches_type (BillingReservation , billing_reservation , path = ["response" ])
103+ billing_reservation = response .parse ()
104+ assert_matches_type (BillingReservation , billing_reservation , path = ["response" ])
93105
94106 assert cast (Any , response .is_closed ) is True
95107
@@ -101,30 +113,35 @@ class TestAsyncBillingReservations:
101113
102114 @parametrize
103115 async def test_method_list (self , async_client : AsyncGcore ) -> None :
104- billing_reservation = await async_client .cloud .billing_reservations .list ()
116+ with pytest .warns (DeprecationWarning ):
117+ billing_reservation = await async_client .cloud .billing_reservations .list ()
118+
105119 assert_matches_type (AsyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
106120
107121 @parametrize
108122 async def test_method_list_with_all_params (self , async_client : AsyncGcore ) -> None :
109- billing_reservation = await async_client .cloud .billing_reservations .list (
110- activated_from = parse_date ("2019-12-27" ),
111- activated_to = parse_date ("2019-12-27" ),
112- created_from = parse_datetime ("2019-12-27T18:11:19.117Z" ),
113- created_to = parse_datetime ("2019-12-27T18:11:19.117Z" ),
114- deactivated_from = parse_date ("2019-12-27" ),
115- deactivated_to = parse_date ("2019-12-27" ),
116- limit = 1 ,
117- metric_name = "metric_name" ,
118- offset = 0 ,
119- order_by = "active_from.asc" ,
120- region_id = 0 ,
121- status = ["ACTIVATED" ],
122- )
123+ with pytest .warns (DeprecationWarning ):
124+ billing_reservation = await async_client .cloud .billing_reservations .list (
125+ activated_from = parse_date ("2019-12-27" ),
126+ activated_to = parse_date ("2019-12-27" ),
127+ created_from = parse_datetime ("2019-12-27T18:11:19.117Z" ),
128+ created_to = parse_datetime ("2019-12-27T18:11:19.117Z" ),
129+ deactivated_from = parse_date ("2019-12-27" ),
130+ deactivated_to = parse_date ("2019-12-27" ),
131+ limit = 1 ,
132+ metric_name = "metric_name" ,
133+ offset = 0 ,
134+ order_by = "active_from.asc" ,
135+ region_id = 0 ,
136+ status = ["ACTIVATED" ],
137+ )
138+
123139 assert_matches_type (AsyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
124140
125141 @parametrize
126142 async def test_raw_response_list (self , async_client : AsyncGcore ) -> None :
127- response = await async_client .cloud .billing_reservations .with_raw_response .list ()
143+ with pytest .warns (DeprecationWarning ):
144+ response = await async_client .cloud .billing_reservations .with_raw_response .list ()
128145
129146 assert response .is_closed is True
130147 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -133,27 +150,31 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
133150
134151 @parametrize
135152 async def test_streaming_response_list (self , async_client : AsyncGcore ) -> None :
136- async with async_client .cloud .billing_reservations .with_streaming_response .list () as response :
137- assert not response .is_closed
138- assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
153+ with pytest .warns (DeprecationWarning ):
154+ async with async_client .cloud .billing_reservations .with_streaming_response .list () as response :
155+ assert not response .is_closed
156+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
139157
140- billing_reservation = await response .parse ()
141- assert_matches_type (AsyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
158+ billing_reservation = await response .parse ()
159+ assert_matches_type (AsyncOffsetPage [BillingReservation ], billing_reservation , path = ["response" ])
142160
143161 assert cast (Any , response .is_closed ) is True
144162
145163 @parametrize
146164 async def test_method_get (self , async_client : AsyncGcore ) -> None :
147- billing_reservation = await async_client .cloud .billing_reservations .get (
148- 0 ,
149- )
165+ with pytest .warns (DeprecationWarning ):
166+ billing_reservation = await async_client .cloud .billing_reservations .get (
167+ 0 ,
168+ )
169+
150170 assert_matches_type (BillingReservation , billing_reservation , path = ["response" ])
151171
152172 @parametrize
153173 async def test_raw_response_get (self , async_client : AsyncGcore ) -> None :
154- response = await async_client .cloud .billing_reservations .with_raw_response .get (
155- 0 ,
156- )
174+ with pytest .warns (DeprecationWarning ):
175+ response = await async_client .cloud .billing_reservations .with_raw_response .get (
176+ 0 ,
177+ )
157178
158179 assert response .is_closed is True
159180 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -162,13 +183,14 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
162183
163184 @parametrize
164185 async def test_streaming_response_get (self , async_client : AsyncGcore ) -> None :
165- async with async_client .cloud .billing_reservations .with_streaming_response .get (
166- 0 ,
167- ) as response :
168- assert not response .is_closed
169- assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
170-
171- billing_reservation = await response .parse ()
172- assert_matches_type (BillingReservation , billing_reservation , path = ["response" ])
186+ with pytest .warns (DeprecationWarning ):
187+ async with async_client .cloud .billing_reservations .with_streaming_response .get (
188+ 0 ,
189+ ) as response :
190+ assert not response .is_closed
191+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
192+
193+ billing_reservation = await response .parse ()
194+ assert_matches_type (BillingReservation , billing_reservation , path = ["response" ])
173195
174196 assert cast (Any , response .is_closed ) is True
0 commit comments