@@ -341,7 +341,7 @@ def test_validate_headers(self) -> None:
341
341
assert request .headers .get ("Authorization" ) == f"Bearer { bearer_token } "
342
342
343
343
with pytest .raises (OxpError ):
344
- with update_env (** {"OXP_BEARER_TOKEN " : Omit ()}):
344
+ with update_env (** {"OXP_API_KEY " : Omit ()}):
345
345
client2 = Oxp (base_url = base_url , bearer_token = None , _strict_response_validation = True )
346
346
_ = client2
347
347
@@ -735,20 +735,20 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
735
735
@mock .patch ("oxp._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
736
736
@pytest .mark .respx (base_url = base_url )
737
737
def test_retrying_timeout_errors_doesnt_leak (self , respx_mock : MockRouter ) -> None :
738
- respx_mock .get ("/health " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
738
+ respx_mock .get ("/tools " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
739
739
740
740
with pytest .raises (APITimeoutError ):
741
- self .client .get ("/health " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }})
741
+ self .client .get ("/tools " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }})
742
742
743
743
assert _get_open_connections (self .client ) == 0
744
744
745
745
@mock .patch ("oxp._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
746
746
@pytest .mark .respx (base_url = base_url )
747
747
def test_retrying_status_errors_doesnt_leak (self , respx_mock : MockRouter ) -> None :
748
- respx_mock .get ("/health " ).mock (return_value = httpx .Response (500 ))
748
+ respx_mock .get ("/tools " ).mock (return_value = httpx .Response (500 ))
749
749
750
750
with pytest .raises (APIStatusError ):
751
- self .client .get ("/health " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }})
751
+ self .client .get ("/tools " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }})
752
752
753
753
assert _get_open_connections (self .client ) == 0
754
754
@@ -776,9 +776,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
776
776
return httpx .Response (500 )
777
777
return httpx .Response (200 )
778
778
779
- respx_mock .get ("/health " ).mock (side_effect = retry_handler )
779
+ respx_mock .get ("/tools " ).mock (side_effect = retry_handler )
780
780
781
- response = client .health .with_raw_response .check ()
781
+ response = client .tools .with_raw_response .list ()
782
782
783
783
assert response .retries_taken == failures_before_success
784
784
assert int (response .http_request .headers .get ("x-stainless-retry-count" )) == failures_before_success
@@ -798,9 +798,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
798
798
return httpx .Response (500 )
799
799
return httpx .Response (200 )
800
800
801
- respx_mock .get ("/health " ).mock (side_effect = retry_handler )
801
+ respx_mock .get ("/tools " ).mock (side_effect = retry_handler )
802
802
803
- response = client .health .with_raw_response .check (extra_headers = {"x-stainless-retry-count" : Omit ()})
803
+ response = client .tools .with_raw_response .list (extra_headers = {"x-stainless-retry-count" : Omit ()})
804
804
805
805
assert len (response .http_request .headers .get_list ("x-stainless-retry-count" )) == 0
806
806
@@ -821,9 +821,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
821
821
return httpx .Response (500 )
822
822
return httpx .Response (200 )
823
823
824
- respx_mock .get ("/health " ).mock (side_effect = retry_handler )
824
+ respx_mock .get ("/tools " ).mock (side_effect = retry_handler )
825
825
826
- response = client .health .with_raw_response .check (extra_headers = {"x-stainless-retry-count" : "42" })
826
+ response = client .tools .with_raw_response .list (extra_headers = {"x-stainless-retry-count" : "42" })
827
827
828
828
assert response .http_request .headers .get ("x-stainless-retry-count" ) == "42"
829
829
@@ -1119,7 +1119,7 @@ def test_validate_headers(self) -> None:
1119
1119
assert request .headers .get ("Authorization" ) == f"Bearer { bearer_token } "
1120
1120
1121
1121
with pytest .raises (OxpError ):
1122
- with update_env (** {"OXP_BEARER_TOKEN " : Omit ()}):
1122
+ with update_env (** {"OXP_API_KEY " : Omit ()}):
1123
1123
client2 = AsyncOxp (base_url = base_url , bearer_token = None , _strict_response_validation = True )
1124
1124
_ = client2
1125
1125
@@ -1517,23 +1517,23 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
1517
1517
@mock .patch ("oxp._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
1518
1518
@pytest .mark .respx (base_url = base_url )
1519
1519
async def test_retrying_timeout_errors_doesnt_leak (self , respx_mock : MockRouter ) -> None :
1520
- respx_mock .get ("/health " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
1520
+ respx_mock .get ("/tools " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
1521
1521
1522
1522
with pytest .raises (APITimeoutError ):
1523
1523
await self .client .get (
1524
- "/health " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }}
1524
+ "/tools " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }}
1525
1525
)
1526
1526
1527
1527
assert _get_open_connections (self .client ) == 0
1528
1528
1529
1529
@mock .patch ("oxp._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
1530
1530
@pytest .mark .respx (base_url = base_url )
1531
1531
async def test_retrying_status_errors_doesnt_leak (self , respx_mock : MockRouter ) -> None :
1532
- respx_mock .get ("/health " ).mock (return_value = httpx .Response (500 ))
1532
+ respx_mock .get ("/tools " ).mock (return_value = httpx .Response (500 ))
1533
1533
1534
1534
with pytest .raises (APIStatusError ):
1535
1535
await self .client .get (
1536
- "/health " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }}
1536
+ "/tools " , cast_to = httpx .Response , options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }}
1537
1537
)
1538
1538
1539
1539
assert _get_open_connections (self .client ) == 0
@@ -1563,9 +1563,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
1563
1563
return httpx .Response (500 )
1564
1564
return httpx .Response (200 )
1565
1565
1566
- respx_mock .get ("/health " ).mock (side_effect = retry_handler )
1566
+ respx_mock .get ("/tools " ).mock (side_effect = retry_handler )
1567
1567
1568
- response = await client .health .with_raw_response .check ()
1568
+ response = await client .tools .with_raw_response .list ()
1569
1569
1570
1570
assert response .retries_taken == failures_before_success
1571
1571
assert int (response .http_request .headers .get ("x-stainless-retry-count" )) == failures_before_success
@@ -1588,9 +1588,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
1588
1588
return httpx .Response (500 )
1589
1589
return httpx .Response (200 )
1590
1590
1591
- respx_mock .get ("/health " ).mock (side_effect = retry_handler )
1591
+ respx_mock .get ("/tools " ).mock (side_effect = retry_handler )
1592
1592
1593
- response = await client .health .with_raw_response .check (extra_headers = {"x-stainless-retry-count" : Omit ()})
1593
+ response = await client .tools .with_raw_response .list (extra_headers = {"x-stainless-retry-count" : Omit ()})
1594
1594
1595
1595
assert len (response .http_request .headers .get_list ("x-stainless-retry-count" )) == 0
1596
1596
@@ -1612,9 +1612,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
1612
1612
return httpx .Response (500 )
1613
1613
return httpx .Response (200 )
1614
1614
1615
- respx_mock .get ("/health " ).mock (side_effect = retry_handler )
1615
+ respx_mock .get ("/tools " ).mock (side_effect = retry_handler )
1616
1616
1617
- response = await client .health .with_raw_response .check (extra_headers = {"x-stainless-retry-count" : "42" })
1617
+ response = await client .tools .with_raw_response .list (extra_headers = {"x-stainless-retry-count" : "42" })
1618
1618
1619
1619
assert response .http_request .headers .get ("x-stainless-retry-count" ) == "42"
1620
1620
0 commit comments