chore: update SDK client, memory docs, and tests

This commit is contained in:
2026-03-24 18:41:29 -07:00
parent e0a1c5f74a
commit f5f1a90ca3
74 changed files with 790 additions and 790 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ These capabilities support more personalized, contextually aware, and human-like
### Authentication
* **Production**: All endpoints require an API key provided via the `x-hanzo-api-key` HTTP header or set in the `HANZO_API_KEY` environment variable.
* **Production**: All endpoints require an API key provided via the `x-api-key` HTTP header or set in the `HANZO_API_KEY` environment variable.
* **Local Development**: Authentication can be disabled when running locally by setting `DISABLE_AUTH=true` or omitting the header.
> **Note:** All endpoints are RESTful and expect JSON request bodies with **lowercase** key names (e.g., `userid`, `messagecontent`). The `userid` parameter is **mandatory** for most endpoints; it partitions data per user to ensure multi-tenancy and security.
@@ -294,7 +294,7 @@ CREATE TABLE fact_relations (
### Endpoints
All endpoints require `userid` and either the `x-hanzo-api-key` header or `HANZO_API_KEY` environment variable (unless `DISABLE_AUTH=true`).
All endpoints require `userid` and either the `x-api-key` header or `HANZO_API_KEY` environment variable (unless `DISABLE_AUTH=true`).
#### 1. POST /v1/knowledge/bases/create
+1 -1
View File
@@ -30,7 +30,7 @@ Authorization: Bearer YOUR_API_KEY
```
Alternative authentication methods:
- `x-hanzo-api-key` header
- `x-api-key` header
- `x-api-key` header
- `apikey` in request body (for backwards compatibility)
@@ -17,7 +17,7 @@ def get_api_key(
Checks in order:
1. Authorization header (Bearer token)
2. x-hanzo-api-key header
2. x-api-key header
3. x-api-key header
4. apikey in JSON body
@@ -33,7 +33,7 @@ def get_api_key(
return credentials.credentials
# Check custom headers
api_key = request.headers.get("x-hanzo-api-key")
api_key = request.headers.get("x-api-key")
if api_key:
return api_key
+10 -10
View File
@@ -426,9 +426,9 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
# Don't set these headers if they were already set or removed by the caller. We check
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
lower_custom_headers = [header.lower() for header in custom_headers]
if "x-hanzo-retry-count" not in lower_custom_headers:
headers["x-hanzo-retry-count"] = str(retries_taken)
if "x-hanzo-read-timeout" not in lower_custom_headers:
if "x-sdk-retry-count" not in lower_custom_headers:
headers["x-sdk-retry-count"] = str(retries_taken)
if "x-sdk-read-timeout" not in lower_custom_headers:
timeout = (
self.timeout
if isinstance(options.timeout, NotGiven)
@@ -437,7 +437,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
if isinstance(timeout, Timeout):
timeout = timeout.read
if timeout is not None:
headers["x-hanzo-read-timeout"] = str(timeout)
headers["x-sdk-read-timeout"] = str(timeout)
return headers
@@ -1984,12 +1984,12 @@ def get_platform() -> Platform:
@lru_cache(maxsize=None)
def platform_headers(version: str, *, platform: Platform | None) -> Dict[str, str]:
return {
"X-Hanzo-Lang": "python",
"X-Hanzo-Package-Version": version,
"X-Hanzo-OS": str(platform or get_platform()),
"X-Hanzo-Arch": str(get_architecture()),
"X-Hanzo-Runtime": get_python_runtime(),
"X-Hanzo-Runtime-Version": get_python_version(),
"X-SDK-Lang": "python",
"X-SDK-Package-Version": version,
"X-SDK-OS": str(platform or get_platform()),
"X-SDK-Arch": str(get_architecture()),
"X-SDK-Runtime": get_python_runtime(),
"X-SDK-Runtime-Version": get_python_version(),
}
+2 -2
View File
@@ -488,7 +488,7 @@ class Hanzo(SyncAPIClient):
def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"X-Hanzo-Async": "false",
"X-SDK-Async": "false",
**self._custom_headers,
}
@@ -932,7 +932,7 @@ class AsyncHanzo(AsyncAPIClient):
def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"X-Hanzo-Async": f"async:{get_async_library()}",
"X-SDK-Async": f"async:{get_async_library()}",
**self._custom_headers,
}
+1 -1
View File
@@ -2,7 +2,7 @@
import httpx
RAW_RESPONSE_HEADER = "X-Hanzo-Raw-Response"
RAW_RESPONSE_HEADER = "X-SDK-Raw-Response"
OVERRIDE_CAST_TO_HEADER = "____hanzo_override_cast_to"
# default timeout is 1 minute
+2 -2
View File
@@ -64,7 +64,7 @@ class CacheResource(SyncAPIResource):
"""Endpoint for deleting a key from the cache.
All responses from hanzo proxy
have `x-hanzo-cache-key` in the headers
have `x-cache-key` in the headers
Parameters:
@@ -180,7 +180,7 @@ class AsyncCacheResource(AsyncAPIResource):
"""Endpoint for deleting a key from the cache.
All responses from hanzo proxy
have `x-hanzo-cache-key` in the headers
have `x-cache-key` in the headers
Parameters:
+2 -2
View File
@@ -61,7 +61,7 @@ class InfoResource(SyncAPIResource):
descriptions (except api key and api base)
Parameters: hanzo_model_id: Optional[str] = None (this is the value of
`x-hanzo-model-id` returned in response headers)
`x-model-id` returned in response headers)
- When hanzo_model_id is passed, it will return the info for that specific model
- When hanzo_model_id is not passed, it will return the info for all models
@@ -148,7 +148,7 @@ class AsyncInfoResource(AsyncAPIResource):
descriptions (except api key and api base)
Parameters: hanzo_model_id: Optional[str] = None (this is the value of
`x-hanzo-model-id` returned in response headers)
`x-model-id` returned in response headers)
- When hanzo_model_id is passed, it will return the info for that specific model
- When hanzo_model_id is not passed, it will return the info for all models
+4 -4
View File
@@ -26,7 +26,7 @@ class TestSpeech:
response = client.audio.speech.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
speech = response.parse()
assert_matches_type(object, speech, path=["response"])
@@ -34,7 +34,7 @@ class TestSpeech:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.audio.speech.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
speech = response.parse()
assert_matches_type(object, speech, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncSpeech:
response = await async_client.audio.speech.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
speech = await response.parse()
assert_matches_type(object, speech, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncSpeech:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.audio.speech.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
speech = await response.parse()
assert_matches_type(object, speech, path=["response"])
@@ -30,7 +30,7 @@ class TestTranscriptions:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
transcription = response.parse()
assert_matches_type(object, transcription, path=["response"])
@@ -40,7 +40,7 @@ class TestTranscriptions:
file=b"raw file contents",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
transcription = response.parse()
assert_matches_type(object, transcription, path=["response"])
@@ -65,7 +65,7 @@ class TestAsyncTranscriptions:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
transcription = await response.parse()
assert_matches_type(object, transcription, path=["response"])
@@ -75,7 +75,7 @@ class TestAsyncTranscriptions:
file=b"raw file contents",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
transcription = await response.parse()
assert_matches_type(object, transcription, path=["response"])
+4 -4
View File
@@ -38,7 +38,7 @@ class TestCancel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = response.parse()
assert_matches_type(object, cancel, path=["response"])
@@ -48,7 +48,7 @@ class TestCancel:
batch_id="batch_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = response.parse()
assert_matches_type(object, cancel, path=["response"])
@@ -91,7 +91,7 @@ class TestAsyncCancel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = await response.parse()
assert_matches_type(object, cancel, path=["response"])
@@ -101,7 +101,7 @@ class TestAsyncCancel:
batch_id="batch_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = await response.parse()
assert_matches_type(object, cancel, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestRedis:
response = client.cache.redis.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
redi = response.parse()
assert_matches_type(object, redi, path=["response"])
@@ -34,7 +34,7 @@ class TestRedis:
def test_streaming_response_retrieve_info(self, client: Hanzo) -> None:
with client.cache.redis.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
redi = response.parse()
assert_matches_type(object, redi, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncRedis:
response = await async_client.cache.redis.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
redi = await response.parse()
assert_matches_type(object, redi, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncRedis:
async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None:
async with async_client.cache.redis.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
redi = await response.parse()
assert_matches_type(object, redi, path=["response"])
+4 -4
View File
@@ -33,7 +33,7 @@ class TestCompletions:
response = client.chat.completions.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -41,7 +41,7 @@ class TestCompletions:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.chat.completions.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -69,7 +69,7 @@ class TestAsyncCompletions:
response = await async_client.chat.completions.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = await response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -77,7 +77,7 @@ class TestAsyncCompletions:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.chat.completions.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = await response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -37,7 +37,7 @@ class TestPassThroughEndpoint:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -49,7 +49,7 @@ class TestPassThroughEndpoint:
target="target",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -70,7 +70,7 @@ class TestPassThroughEndpoint:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -80,7 +80,7 @@ class TestPassThroughEndpoint:
"endpoint_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -114,7 +114,7 @@ class TestPassThroughEndpoint:
response = client.config.pass_through_endpoint.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -122,7 +122,7 @@ class TestPassThroughEndpoint:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.config.pass_through_endpoint.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -143,7 +143,7 @@ class TestPassThroughEndpoint:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -153,7 +153,7 @@ class TestPassThroughEndpoint:
endpoint_id="endpoint_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -182,7 +182,7 @@ class TestAsyncPassThroughEndpoint:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -194,7 +194,7 @@ class TestAsyncPassThroughEndpoint:
target="target",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -215,7 +215,7 @@ class TestAsyncPassThroughEndpoint:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -225,7 +225,7 @@ class TestAsyncPassThroughEndpoint:
"endpoint_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(object, pass_through_endpoint, path=["response"])
@@ -259,7 +259,7 @@ class TestAsyncPassThroughEndpoint:
response = await async_client.config.pass_through_endpoint.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -267,7 +267,7 @@ class TestAsyncPassThroughEndpoint:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.config.pass_through_endpoint.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -288,7 +288,7 @@ class TestAsyncPassThroughEndpoint:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
@@ -298,7 +298,7 @@ class TestAsyncPassThroughEndpoint:
endpoint_id="endpoint_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
pass_through_endpoint = await response.parse()
assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"])
+4 -4
View File
@@ -30,7 +30,7 @@ class TestChat:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -40,7 +40,7 @@ class TestChat:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -72,7 +72,7 @@ class TestAsyncChat:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = await response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -82,7 +82,7 @@ class TestAsyncChat:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = await response.parse()
assert_matches_type(object, chat, path=["response"])
+4 -4
View File
@@ -34,7 +34,7 @@ class TestContent:
provider="provider",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
content = response.parse()
assert_matches_type(object, content, path=["response"])
@@ -45,7 +45,7 @@ class TestContent:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
content = response.parse()
assert_matches_type(object, content, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -89,7 +89,7 @@ class TestAsyncContent:
provider="provider",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
content = await response.parse()
assert_matches_type(object, content, path=["response"])
@@ -100,7 +100,7 @@ class TestAsyncContent:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
content = await response.parse()
assert content == "file content" or isinstance(content, (str, bytes, object))
assert cast(Any, response.is_closed) is True
@@ -30,7 +30,7 @@ class TestCancel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = response.parse()
assert_matches_type(object, cancel, path=["response"])
@@ -40,7 +40,7 @@ class TestCancel:
"fine_tuning_job_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = response.parse()
assert_matches_type(object, cancel, path=["response"])
@@ -75,7 +75,7 @@ class TestAsyncCancel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = await response.parse()
assert_matches_type(object, cancel, path=["response"])
@@ -85,7 +85,7 @@ class TestAsyncCancel:
"fine_tuning_job_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cancel = await response.parse()
assert_matches_type(object, cancel, path=["response"])
+12 -12
View File
@@ -52,7 +52,7 @@ class TestJobs:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = response.parse()
assert_matches_type(object, job, path=["response"])
@@ -64,7 +64,7 @@ class TestJobs:
training_file="training_file",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = response.parse()
assert_matches_type(object, job, path=["response"])
@@ -87,7 +87,7 @@ class TestJobs:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = response.parse()
assert_matches_type(object, job, path=["response"])
@@ -98,7 +98,7 @@ class TestJobs:
custom_llm_provider="openai",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = response.parse()
assert_matches_type(object, job, path=["response"])
@@ -139,7 +139,7 @@ class TestJobs:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = response.parse()
assert_matches_type(object, job, path=["response"])
@@ -149,7 +149,7 @@ class TestJobs:
custom_llm_provider="openai",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = response.parse()
assert_matches_type(object, job, path=["response"])
@@ -196,7 +196,7 @@ class TestAsyncJobs:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = await response.parse()
assert_matches_type(object, job, path=["response"])
@@ -208,7 +208,7 @@ class TestAsyncJobs:
training_file="training_file",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = await response.parse()
assert_matches_type(object, job, path=["response"])
@@ -231,7 +231,7 @@ class TestAsyncJobs:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = await response.parse()
assert_matches_type(object, job, path=["response"])
@@ -242,7 +242,7 @@ class TestAsyncJobs:
custom_llm_provider="openai",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = await response.parse()
assert_matches_type(object, job, path=["response"])
@@ -283,7 +283,7 @@ class TestAsyncJobs:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = await response.parse()
assert_matches_type(object, job, path=["response"])
@@ -293,7 +293,7 @@ class TestAsyncJobs:
custom_llm_provider="openai",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
job = await response.parse()
assert_matches_type(object, job, path=["response"])
+12 -12
View File
@@ -39,7 +39,7 @@ class TestSpend:
response = client.global_.spend.with_raw_response.list_tags()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -47,7 +47,7 @@ class TestSpend:
def test_streaming_response_list_tags(self, client: Hanzo) -> None:
with client.global_.spend.with_streaming_response.list_tags() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -64,7 +64,7 @@ class TestSpend:
response = client.global_.spend.with_raw_response.reset()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -72,7 +72,7 @@ class TestSpend:
def test_streaming_response_reset(self, client: Hanzo) -> None:
with client.global_.spend.with_streaming_response.reset() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -102,7 +102,7 @@ class TestSpend:
response = client.global_.spend.with_raw_response.retrieve_report()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"])
@@ -110,7 +110,7 @@ class TestSpend:
def test_streaming_response_retrieve_report(self, client: Hanzo) -> None:
with client.global_.spend.with_streaming_response.retrieve_report() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"])
@@ -140,7 +140,7 @@ class TestAsyncSpend:
response = await async_client.global_.spend.with_raw_response.list_tags()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -148,7 +148,7 @@ class TestAsyncSpend:
async def test_streaming_response_list_tags(self, async_client: AsyncHanzo) -> None:
async with async_client.global_.spend.with_streaming_response.list_tags() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -165,7 +165,7 @@ class TestAsyncSpend:
response = await async_client.global_.spend.with_raw_response.reset()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -173,7 +173,7 @@ class TestAsyncSpend:
async def test_streaming_response_reset(self, async_client: AsyncHanzo) -> None:
async with async_client.global_.spend.with_streaming_response.reset() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -203,7 +203,7 @@ class TestAsyncSpend:
response = await async_client.global_.spend.with_raw_response.retrieve_report()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"])
@@ -211,7 +211,7 @@ class TestAsyncSpend:
async def test_streaming_response_retrieve_report(self, async_client: AsyncHanzo) -> None:
async with async_client.global_.spend.with_streaming_response.retrieve_report() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"])
@@ -26,7 +26,7 @@ class TestGenerations:
response = client.images.generations.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
generation = response.parse()
assert_matches_type(object, generation, path=["response"])
@@ -34,7 +34,7 @@ class TestGenerations:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.images.generations.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
generation = response.parse()
assert_matches_type(object, generation, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncGenerations:
response = await async_client.images.generations.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
generation = await response.parse()
assert_matches_type(object, generation, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncGenerations:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.images.generations.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
generation = await response.parse()
assert_matches_type(object, generation, path=["response"])
+4 -4
View File
@@ -33,7 +33,7 @@ class TestInfo:
response = client.model.info.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = response.parse()
assert_matches_type(object, info, path=["response"])
@@ -41,7 +41,7 @@ class TestInfo:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.model.info.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = response.parse()
assert_matches_type(object, info, path=["response"])
@@ -69,7 +69,7 @@ class TestAsyncInfo:
response = await async_client.model.info.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = await response.parse()
assert_matches_type(object, info, path=["response"])
@@ -77,7 +77,7 @@ class TestAsyncInfo:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.model.info.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = await response.parse()
assert_matches_type(object, info, path=["response"])
+8 -8
View File
@@ -79,7 +79,7 @@ class TestUpdate:
response = client.model.update.with_raw_response.full()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = response.parse()
assert_matches_type(object, update, path=["response"])
@@ -87,7 +87,7 @@ class TestUpdate:
def test_streaming_response_full(self, client: Hanzo) -> None:
with client.model.update.with_streaming_response.full() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = response.parse()
assert_matches_type(object, update, path=["response"])
@@ -161,7 +161,7 @@ class TestUpdate:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = response.parse()
assert_matches_type(object, update, path=["response"])
@@ -171,7 +171,7 @@ class TestUpdate:
model_id="model_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = response.parse()
assert_matches_type(object, update, path=["response"])
@@ -254,7 +254,7 @@ class TestAsyncUpdate:
response = await async_client.model.update.with_raw_response.full()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = await response.parse()
assert_matches_type(object, update, path=["response"])
@@ -262,7 +262,7 @@ class TestAsyncUpdate:
async def test_streaming_response_full(self, async_client: AsyncHanzo) -> None:
async with async_client.model.update.with_streaming_response.full() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = await response.parse()
assert_matches_type(object, update, path=["response"])
@@ -336,7 +336,7 @@ class TestAsyncUpdate:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = await response.parse()
assert_matches_type(object, update, path=["response"])
@@ -346,7 +346,7 @@ class TestAsyncUpdate:
model_id="model_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
update = await response.parse()
assert_matches_type(object, update, path=["response"])
@@ -30,7 +30,7 @@ class TestChat:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -40,7 +40,7 @@ class TestChat:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -72,7 +72,7 @@ class TestAsyncChat:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = await response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -82,7 +82,7 @@ class TestAsyncChat:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
chat = await response.parse()
assert_matches_type(object, chat, path=["response"])
@@ -30,7 +30,7 @@ class TestDeployments:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -40,7 +40,7 @@ class TestDeployments:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -68,7 +68,7 @@ class TestDeployments:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -78,7 +78,7 @@ class TestDeployments:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -110,7 +110,7 @@ class TestAsyncDeployments:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = await response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -120,7 +120,7 @@ class TestAsyncDeployments:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = await response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -148,7 +148,7 @@ class TestAsyncDeployments:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = await response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -158,7 +158,7 @@ class TestAsyncDeployments:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
deployment = await response.parse()
assert_matches_type(object, deployment, path=["response"])
@@ -31,7 +31,7 @@ class TestInfo:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = response.parse()
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@@ -41,7 +41,7 @@ class TestInfo:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = response.parse()
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@@ -62,7 +62,7 @@ class TestInfo:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = response.parse()
assert_matches_type(object, info, path=["response"])
@@ -72,7 +72,7 @@ class TestInfo:
organizations=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = response.parse()
assert_matches_type(object, info, path=["response"])
@@ -97,7 +97,7 @@ class TestAsyncInfo:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = await response.parse()
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@@ -107,7 +107,7 @@ class TestAsyncInfo:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = await response.parse()
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@@ -128,7 +128,7 @@ class TestAsyncInfo:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = await response.parse()
assert_matches_type(object, info, path=["response"])
@@ -138,7 +138,7 @@ class TestAsyncInfo:
organizations=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
info = await response.parse()
assert_matches_type(object, info, path=["response"])
@@ -30,7 +30,7 @@ class TestInputItems:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
input_item = response.parse()
assert_matches_type(object, input_item, path=["response"])
@@ -40,7 +40,7 @@ class TestInputItems:
"response_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
input_item = response.parse()
assert_matches_type(object, input_item, path=["response"])
@@ -75,7 +75,7 @@ class TestAsyncInputItems:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
input_item = await response.parse()
assert_matches_type(object, input_item, path=["response"])
@@ -85,7 +85,7 @@ class TestAsyncInputItems:
"response_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
input_item = await response.parse()
assert_matches_type(object, input_item, path=["response"])
+8 -8
View File
@@ -30,7 +30,7 @@ class TestCallback:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -40,7 +40,7 @@ class TestCallback:
"team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -86,7 +86,7 @@ class TestCallback:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -98,7 +98,7 @@ class TestCallback:
callback_vars={"foo": "string"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -135,7 +135,7 @@ class TestAsyncCallback:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = await response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -145,7 +145,7 @@ class TestAsyncCallback:
"team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = await response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -191,7 +191,7 @@ class TestAsyncCallback:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = await response.parse()
assert_matches_type(object, callback, path=["response"])
@@ -203,7 +203,7 @@ class TestAsyncCallback:
callback_vars={"foo": "string"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
callback = await response.parse()
assert_matches_type(object, callback, path=["response"])
+8 -8
View File
@@ -32,7 +32,7 @@ class TestModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -43,7 +43,7 @@ class TestModel:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -66,7 +66,7 @@ class TestModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -77,7 +77,7 @@ class TestModel:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -104,7 +104,7 @@ class TestAsyncModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -115,7 +115,7 @@ class TestAsyncModel:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -138,7 +138,7 @@ class TestAsyncModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -149,7 +149,7 @@ class TestAsyncModel:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestActive:
response = client.active.with_raw_response.list_callbacks()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
active = response.parse()
assert_matches_type(object, active, path=["response"])
@@ -34,7 +34,7 @@ class TestActive:
def test_streaming_response_list_callbacks(self, client: Hanzo) -> None:
with client.active.with_streaming_response.list_callbacks() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
active = response.parse()
assert_matches_type(object, active, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncActive:
response = await async_client.active.with_raw_response.list_callbacks()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
active = await response.parse()
assert_matches_type(object, active, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncActive:
async def test_streaming_response_list_callbacks(self, async_client: AsyncHanzo) -> None:
async with async_client.active.with_streaming_response.list_callbacks() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
active = await response.parse()
assert_matches_type(object, active, path=["response"])
+4 -4
View File
@@ -30,7 +30,7 @@ class TestAdd:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
add = response.parse()
assert_matches_type(object, add, path=["response"])
@@ -40,7 +40,7 @@ class TestAdd:
ip="ip",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
add = response.parse()
assert_matches_type(object, add, path=["response"])
@@ -65,7 +65,7 @@ class TestAsyncAdd:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
add = await response.parse()
assert_matches_type(object, add, path=["response"])
@@ -75,7 +75,7 @@ class TestAsyncAdd:
ip="ip",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
add = await response.parse()
assert_matches_type(object, add, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -40,7 +40,7 @@ class TestAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -71,7 +71,7 @@ class TestAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -81,7 +81,7 @@ class TestAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -112,7 +112,7 @@ class TestAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -122,7 +122,7 @@ class TestAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -153,7 +153,7 @@ class TestAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -163,7 +163,7 @@ class TestAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -194,7 +194,7 @@ class TestAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -204,7 +204,7 @@ class TestAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncAnthropic:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncAnthropic:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
anthropic = await response.parse()
assert_matches_type(object, anthropic, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -40,7 +40,7 @@ class TestAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -71,7 +71,7 @@ class TestAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -81,7 +81,7 @@ class TestAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -112,7 +112,7 @@ class TestAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -122,7 +122,7 @@ class TestAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -153,7 +153,7 @@ class TestAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -163,7 +163,7 @@ class TestAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -194,7 +194,7 @@ class TestAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -204,7 +204,7 @@ class TestAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assemblyai = await response.parse()
assert_matches_type(object, assemblyai, path=["response"])
+12 -12
View File
@@ -26,7 +26,7 @@ class TestAssistants:
response = client.assistants.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -34,7 +34,7 @@ class TestAssistants:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.assistants.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -51,7 +51,7 @@ class TestAssistants:
response = client.assistants.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -59,7 +59,7 @@ class TestAssistants:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.assistants.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -80,7 +80,7 @@ class TestAssistants:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -90,7 +90,7 @@ class TestAssistants:
"assistant_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -121,7 +121,7 @@ class TestAsyncAssistants:
response = await async_client.assistants.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = await response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -129,7 +129,7 @@ class TestAsyncAssistants:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.assistants.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = await response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -146,7 +146,7 @@ class TestAsyncAssistants:
response = await async_client.assistants.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = await response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -154,7 +154,7 @@ class TestAsyncAssistants:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.assistants.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = await response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -175,7 +175,7 @@ class TestAsyncAssistants:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = await response.parse()
assert_matches_type(object, assistant, path=["response"])
@@ -185,7 +185,7 @@ class TestAsyncAssistants:
"assistant_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
assistant = await response.parse()
assert_matches_type(object, assistant, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -40,7 +40,7 @@ class TestAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -71,7 +71,7 @@ class TestAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -81,7 +81,7 @@ class TestAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -112,7 +112,7 @@ class TestAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -122,7 +122,7 @@ class TestAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -153,7 +153,7 @@ class TestAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -163,7 +163,7 @@ class TestAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -194,7 +194,7 @@ class TestAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -204,7 +204,7 @@ class TestAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncAzure:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncAzure:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
azure = await response.parse()
assert_matches_type(object, azure, path=["response"])
+28 -28
View File
@@ -33,7 +33,7 @@ class TestBatches:
response = client.batches.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -41,7 +41,7 @@ class TestBatches:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.batches.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -70,7 +70,7 @@ class TestBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -80,7 +80,7 @@ class TestBatches:
batch_id="batch_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -116,7 +116,7 @@ class TestBatches:
response = client.batches.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -124,7 +124,7 @@ class TestBatches:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.batches.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -147,7 +147,7 @@ class TestBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -158,7 +158,7 @@ class TestBatches:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -199,7 +199,7 @@ class TestBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -209,7 +209,7 @@ class TestBatches:
"provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -249,7 +249,7 @@ class TestBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -259,7 +259,7 @@ class TestBatches:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -292,7 +292,7 @@ class TestBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -303,7 +303,7 @@ class TestBatches:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -351,7 +351,7 @@ class TestAsyncBatches:
response = await async_client.batches.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -359,7 +359,7 @@ class TestAsyncBatches:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.batches.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -388,7 +388,7 @@ class TestAsyncBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -398,7 +398,7 @@ class TestAsyncBatches:
batch_id="batch_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -434,7 +434,7 @@ class TestAsyncBatches:
response = await async_client.batches.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -442,7 +442,7 @@ class TestAsyncBatches:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.batches.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -465,7 +465,7 @@ class TestAsyncBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -476,7 +476,7 @@ class TestAsyncBatches:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -517,7 +517,7 @@ class TestAsyncBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -527,7 +527,7 @@ class TestAsyncBatches:
"provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -567,7 +567,7 @@ class TestAsyncBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -577,7 +577,7 @@ class TestAsyncBatches:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -610,7 +610,7 @@ class TestAsyncBatches:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
@@ -621,7 +621,7 @@ class TestAsyncBatches:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
batch = await response.parse()
assert_matches_type(object, batch, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -40,7 +40,7 @@ class TestBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -71,7 +71,7 @@ class TestBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -81,7 +81,7 @@ class TestBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -112,7 +112,7 @@ class TestBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -122,7 +122,7 @@ class TestBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -153,7 +153,7 @@ class TestBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -163,7 +163,7 @@ class TestBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -194,7 +194,7 @@ class TestBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -204,7 +204,7 @@ class TestBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncBedrock:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncBedrock:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
bedrock = await response.parse()
assert_matches_type(object, bedrock, path=["response"])
+24 -24
View File
@@ -47,7 +47,7 @@ class TestBudget:
response = client.budget.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -55,7 +55,7 @@ class TestBudget:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.budget.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -93,7 +93,7 @@ class TestBudget:
response = client.budget.with_raw_response.update()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -101,7 +101,7 @@ class TestBudget:
def test_streaming_response_update(self, client: Hanzo) -> None:
with client.budget.with_streaming_response.update() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -118,7 +118,7 @@ class TestBudget:
response = client.budget.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -126,7 +126,7 @@ class TestBudget:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.budget.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -147,7 +147,7 @@ class TestBudget:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -157,7 +157,7 @@ class TestBudget:
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -178,7 +178,7 @@ class TestBudget:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -188,7 +188,7 @@ class TestBudget:
budgets=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -209,7 +209,7 @@ class TestBudget:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -219,7 +219,7 @@ class TestBudget:
budget_id="budget_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -261,7 +261,7 @@ class TestAsyncBudget:
response = await async_client.budget.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -269,7 +269,7 @@ class TestAsyncBudget:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.budget.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -307,7 +307,7 @@ class TestAsyncBudget:
response = await async_client.budget.with_raw_response.update()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -315,7 +315,7 @@ class TestAsyncBudget:
async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None:
async with async_client.budget.with_streaming_response.update() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -332,7 +332,7 @@ class TestAsyncBudget:
response = await async_client.budget.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -340,7 +340,7 @@ class TestAsyncBudget:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.budget.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -361,7 +361,7 @@ class TestAsyncBudget:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -371,7 +371,7 @@ class TestAsyncBudget:
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -392,7 +392,7 @@ class TestAsyncBudget:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -402,7 +402,7 @@ class TestAsyncBudget:
budgets=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -423,7 +423,7 @@ class TestAsyncBudget:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
@@ -433,7 +433,7 @@ class TestAsyncBudget:
budget_id="budget_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
budget = await response.parse()
assert_matches_type(object, budget, path=["response"])
+12 -12
View File
@@ -27,7 +27,7 @@ class TestCache:
response = client.cache.with_raw_response.delete()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -35,7 +35,7 @@ class TestCache:
def test_streaming_response_delete(self, client: Hanzo) -> None:
with client.cache.with_streaming_response.delete() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -52,7 +52,7 @@ class TestCache:
response = client.cache.with_raw_response.flush_all()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -60,7 +60,7 @@ class TestCache:
def test_streaming_response_flush_all(self, client: Hanzo) -> None:
with client.cache.with_streaming_response.flush_all() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -77,7 +77,7 @@ class TestCache:
response = client.cache.with_raw_response.ping()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = response.parse()
assert_matches_type(CachePingResponse, cache, path=["response"])
@@ -85,7 +85,7 @@ class TestCache:
def test_streaming_response_ping(self, client: Hanzo) -> None:
with client.cache.with_streaming_response.ping() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = response.parse()
assert_matches_type(CachePingResponse, cache, path=["response"])
@@ -106,7 +106,7 @@ class TestAsyncCache:
response = await async_client.cache.with_raw_response.delete()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = await response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -114,7 +114,7 @@ class TestAsyncCache:
async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None:
async with async_client.cache.with_streaming_response.delete() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = await response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -131,7 +131,7 @@ class TestAsyncCache:
response = await async_client.cache.with_raw_response.flush_all()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = await response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -139,7 +139,7 @@ class TestAsyncCache:
async def test_streaming_response_flush_all(self, async_client: AsyncHanzo) -> None:
async with async_client.cache.with_streaming_response.flush_all() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = await response.parse()
assert_matches_type(object, cache, path=["response"])
@@ -156,7 +156,7 @@ class TestAsyncCache:
response = await async_client.cache.with_raw_response.ping()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = await response.parse()
assert_matches_type(CachePingResponse, cache, path=["response"])
@@ -164,7 +164,7 @@ class TestAsyncCache:
async def test_streaming_response_ping(self, async_client: AsyncHanzo) -> None:
async with async_client.cache.with_streaming_response.ping() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cache = await response.parse()
assert_matches_type(CachePingResponse, cache, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestClient:
response = client.with_raw_response.get_home()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
client_ = response.parse()
assert_matches_type(object, client_, path=["response"])
@@ -34,7 +34,7 @@ class TestClient:
def test_streaming_response_get_home(self, client: Hanzo) -> None:
with client.with_streaming_response.get_home() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
client_ = response.parse()
assert_matches_type(object, client_, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncClient:
response = await async_client.with_raw_response.get_home()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
client = await response.parse()
assert_matches_type(object, client, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncClient:
async def test_streaming_response_get_home(self, async_client: AsyncHanzo) -> None:
async with async_client.with_streaming_response.get_home() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
client = await response.parse()
assert_matches_type(object, client, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -40,7 +40,7 @@ class TestCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -71,7 +71,7 @@ class TestCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -81,7 +81,7 @@ class TestCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -112,7 +112,7 @@ class TestCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -122,7 +122,7 @@ class TestCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -153,7 +153,7 @@ class TestCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -163,7 +163,7 @@ class TestCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -194,7 +194,7 @@ class TestCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -204,7 +204,7 @@ class TestCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncCohere:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncCohere:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
cohere = await response.parse()
assert_matches_type(object, cohere, path=["response"])
+4 -4
View File
@@ -33,7 +33,7 @@ class TestCompletions:
response = client.completions.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -41,7 +41,7 @@ class TestCompletions:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.completions.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -69,7 +69,7 @@ class TestAsyncCompletions:
response = await async_client.completions.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = await response.parse()
assert_matches_type(object, completion, path=["response"])
@@ -77,7 +77,7 @@ class TestAsyncCompletions:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.completions.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
completion = await response.parse()
assert_matches_type(object, completion, path=["response"])
+12 -12
View File
@@ -42,7 +42,7 @@ class TestCredentials:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -53,7 +53,7 @@ class TestCredentials:
credential_name="credential_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -70,7 +70,7 @@ class TestCredentials:
response = client.credentials.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -78,7 +78,7 @@ class TestCredentials:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.credentials.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -99,7 +99,7 @@ class TestCredentials:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -109,7 +109,7 @@ class TestCredentials:
"credential_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -156,7 +156,7 @@ class TestAsyncCredentials:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -167,7 +167,7 @@ class TestAsyncCredentials:
credential_name="credential_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -184,7 +184,7 @@ class TestAsyncCredentials:
response = await async_client.credentials.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -192,7 +192,7 @@ class TestAsyncCredentials:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.credentials.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -213,7 +213,7 @@ class TestAsyncCredentials:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@@ -223,7 +223,7 @@ class TestAsyncCredentials:
"credential_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
+28 -28
View File
@@ -60,7 +60,7 @@ class TestCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -70,7 +70,7 @@ class TestCustomer:
user_id="user_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -104,7 +104,7 @@ class TestCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -114,7 +114,7 @@ class TestCustomer:
user_id="user_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -131,7 +131,7 @@ class TestCustomer:
response = client.customer.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(CustomerListResponse, customer, path=["response"])
@@ -139,7 +139,7 @@ class TestCustomer:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.customer.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(CustomerListResponse, customer, path=["response"])
@@ -160,7 +160,7 @@ class TestCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -170,7 +170,7 @@ class TestCustomer:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -191,7 +191,7 @@ class TestCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -201,7 +201,7 @@ class TestCustomer:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -222,7 +222,7 @@ class TestCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(HanzoEndUserTable, customer, path=["response"])
@@ -232,7 +232,7 @@ class TestCustomer:
end_user_id="end_user_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(HanzoEndUserTable, customer, path=["response"])
@@ -253,7 +253,7 @@ class TestCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -263,7 +263,7 @@ class TestCustomer:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -314,7 +314,7 @@ class TestAsyncCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -324,7 +324,7 @@ class TestAsyncCustomer:
user_id="user_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -358,7 +358,7 @@ class TestAsyncCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -368,7 +368,7 @@ class TestAsyncCustomer:
user_id="user_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -385,7 +385,7 @@ class TestAsyncCustomer:
response = await async_client.customer.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(CustomerListResponse, customer, path=["response"])
@@ -393,7 +393,7 @@ class TestAsyncCustomer:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.customer.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(CustomerListResponse, customer, path=["response"])
@@ -414,7 +414,7 @@ class TestAsyncCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -424,7 +424,7 @@ class TestAsyncCustomer:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -445,7 +445,7 @@ class TestAsyncCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -455,7 +455,7 @@ class TestAsyncCustomer:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -476,7 +476,7 @@ class TestAsyncCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(HanzoEndUserTable, customer, path=["response"])
@@ -486,7 +486,7 @@ class TestAsyncCustomer:
end_user_id="end_user_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(HanzoEndUserTable, customer, path=["response"])
@@ -507,7 +507,7 @@ class TestAsyncCustomer:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
@@ -517,7 +517,7 @@ class TestAsyncCustomer:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
customer = await response.parse()
assert_matches_type(object, customer, path=["response"])
+4 -4
View File
@@ -30,7 +30,7 @@ class TestDelete:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
delete = response.parse()
assert_matches_type(object, delete, path=["response"])
@@ -40,7 +40,7 @@ class TestDelete:
ip="ip",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
delete = response.parse()
assert_matches_type(object, delete, path=["response"])
@@ -65,7 +65,7 @@ class TestAsyncDelete:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
delete = await response.parse()
assert_matches_type(object, delete, path=["response"])
@@ -75,7 +75,7 @@ class TestAsyncDelete:
ip="ip",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
delete = await response.parse()
assert_matches_type(object, delete, path=["response"])
+4 -4
View File
@@ -33,7 +33,7 @@ class TestEmbeddings:
response = client.embeddings.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
embedding = response.parse()
assert_matches_type(object, embedding, path=["response"])
@@ -41,7 +41,7 @@ class TestEmbeddings:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.embeddings.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
embedding = response.parse()
assert_matches_type(object, embedding, path=["response"])
@@ -69,7 +69,7 @@ class TestAsyncEmbeddings:
response = await async_client.embeddings.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
embedding = await response.parse()
assert_matches_type(object, embedding, path=["response"])
@@ -77,7 +77,7 @@ class TestAsyncEmbeddings:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.embeddings.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
embedding = await response.parse()
assert_matches_type(object, embedding, path=["response"])
+8 -8
View File
@@ -30,7 +30,7 @@ class TestEngines:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -40,7 +40,7 @@ class TestEngines:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -68,7 +68,7 @@ class TestEngines:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -78,7 +78,7 @@ class TestEngines:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -110,7 +110,7 @@ class TestAsyncEngines:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = await response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -120,7 +120,7 @@ class TestAsyncEngines:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = await response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -148,7 +148,7 @@ class TestAsyncEngines:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = await response.parse()
assert_matches_type(object, engine, path=["response"])
@@ -158,7 +158,7 @@ class TestAsyncEngines:
"model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
engine = await response.parse()
assert_matches_type(object, engine, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -40,7 +40,7 @@ class TestEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -71,7 +71,7 @@ class TestEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -81,7 +81,7 @@ class TestEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -112,7 +112,7 @@ class TestEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -122,7 +122,7 @@ class TestEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -153,7 +153,7 @@ class TestEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -163,7 +163,7 @@ class TestEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -194,7 +194,7 @@ class TestEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -204,7 +204,7 @@ class TestEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncEuAssemblyai:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncEuAssemblyai:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
eu_assemblyai = await response.parse()
assert_matches_type(object, eu_assemblyai, path=["response"])
+16 -16
View File
@@ -44,7 +44,7 @@ class TestFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -56,7 +56,7 @@ class TestFiles:
purpose="purpose",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -91,7 +91,7 @@ class TestFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -102,7 +102,7 @@ class TestFiles:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -151,7 +151,7 @@ class TestFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -161,7 +161,7 @@ class TestFiles:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -194,7 +194,7 @@ class TestFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -205,7 +205,7 @@ class TestFiles:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = response.parse()
assert_matches_type(object, file, path=["response"])
@@ -264,7 +264,7 @@ class TestAsyncFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -276,7 +276,7 @@ class TestAsyncFiles:
purpose="purpose",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -311,7 +311,7 @@ class TestAsyncFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -322,7 +322,7 @@ class TestAsyncFiles:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -371,7 +371,7 @@ class TestAsyncFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -381,7 +381,7 @@ class TestAsyncFiles:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -414,7 +414,7 @@ class TestAsyncFiles:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
@@ -425,7 +425,7 @@ class TestAsyncFiles:
provider="provider",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
file = await response.parse()
assert_matches_type(object, file, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -40,7 +40,7 @@ class TestGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -71,7 +71,7 @@ class TestGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -81,7 +81,7 @@ class TestGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -112,7 +112,7 @@ class TestGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -122,7 +122,7 @@ class TestGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -153,7 +153,7 @@ class TestGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -163,7 +163,7 @@ class TestGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -194,7 +194,7 @@ class TestGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -204,7 +204,7 @@ class TestGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncGemini:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncGemini:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
gemini = await response.parse()
assert_matches_type(object, gemini, path=["response"])
+4 -4
View File
@@ -27,7 +27,7 @@ class TestGuardrails:
response = client.guardrails.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
guardrail = response.parse()
assert_matches_type(GuardrailListResponse, guardrail, path=["response"])
@@ -35,7 +35,7 @@ class TestGuardrails:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.guardrails.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
guardrail = response.parse()
assert_matches_type(GuardrailListResponse, guardrail, path=["response"])
@@ -56,7 +56,7 @@ class TestAsyncGuardrails:
response = await async_client.guardrails.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
guardrail = await response.parse()
assert_matches_type(GuardrailListResponse, guardrail, path=["response"])
@@ -64,7 +64,7 @@ class TestAsyncGuardrails:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.guardrails.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
guardrail = await response.parse()
assert_matches_type(GuardrailListResponse, guardrail, path=["response"])
+20 -20
View File
@@ -33,7 +33,7 @@ class TestHealth:
response = client.health.with_raw_response.check_all()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -41,7 +41,7 @@ class TestHealth:
def test_streaming_response_check_all(self, client: Hanzo) -> None:
with client.health.with_streaming_response.check_all() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -58,7 +58,7 @@ class TestHealth:
response = client.health.with_raw_response.check_liveliness()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -66,7 +66,7 @@ class TestHealth:
def test_streaming_response_check_liveliness(self, client: Hanzo) -> None:
with client.health.with_streaming_response.check_liveliness() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -83,7 +83,7 @@ class TestHealth:
response = client.health.with_raw_response.check_liveness()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -91,7 +91,7 @@ class TestHealth:
def test_streaming_response_check_liveness(self, client: Hanzo) -> None:
with client.health.with_streaming_response.check_liveness() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -108,7 +108,7 @@ class TestHealth:
response = client.health.with_raw_response.check_readiness()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -116,7 +116,7 @@ class TestHealth:
def test_streaming_response_check_readiness(self, client: Hanzo) -> None:
with client.health.with_streaming_response.check_readiness() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -137,7 +137,7 @@ class TestHealth:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -147,7 +147,7 @@ class TestHealth:
service="slack_budget_alerts",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = response.parse()
assert_matches_type(object, health, path=["response"])
@@ -175,7 +175,7 @@ class TestAsyncHealth:
response = await async_client.health.with_raw_response.check_all()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -183,7 +183,7 @@ class TestAsyncHealth:
async def test_streaming_response_check_all(self, async_client: AsyncHanzo) -> None:
async with async_client.health.with_streaming_response.check_all() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -200,7 +200,7 @@ class TestAsyncHealth:
response = await async_client.health.with_raw_response.check_liveliness()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -208,7 +208,7 @@ class TestAsyncHealth:
async def test_streaming_response_check_liveliness(self, async_client: AsyncHanzo) -> None:
async with async_client.health.with_streaming_response.check_liveliness() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -225,7 +225,7 @@ class TestAsyncHealth:
response = await async_client.health.with_raw_response.check_liveness()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -233,7 +233,7 @@ class TestAsyncHealth:
async def test_streaming_response_check_liveness(self, async_client: AsyncHanzo) -> None:
async with async_client.health.with_streaming_response.check_liveness() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -250,7 +250,7 @@ class TestAsyncHealth:
response = await async_client.health.with_raw_response.check_readiness()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -258,7 +258,7 @@ class TestAsyncHealth:
async def test_streaming_response_check_readiness(self, async_client: AsyncHanzo) -> None:
async with async_client.health.with_streaming_response.check_readiness() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -279,7 +279,7 @@ class TestAsyncHealth:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
@@ -289,7 +289,7 @@ class TestAsyncHealth:
service="slack_budget_alerts",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
health = await response.parse()
assert_matches_type(object, health, path=["response"])
+36 -36
View File
@@ -71,7 +71,7 @@ class TestKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -81,7 +81,7 @@ class TestKey:
key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -112,7 +112,7 @@ class TestKey:
response = client.key.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
@@ -120,7 +120,7 @@ class TestKey:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.key.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
@@ -146,7 +146,7 @@ class TestKey:
response = client.key.with_raw_response.delete()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -154,7 +154,7 @@ class TestKey:
def test_streaming_response_delete(self, client: Hanzo) -> None:
with client.key.with_streaming_response.delete() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -183,7 +183,7 @@ class TestKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(Optional[KeyBlockResponse], key, path=["response"])
@@ -193,7 +193,7 @@ class TestKey:
key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(Optional[KeyBlockResponse], key, path=["response"])
@@ -210,7 +210,7 @@ class TestKey:
response = client.key.with_raw_response.check_health()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(KeyCheckHealthResponse, key, path=["response"])
@@ -218,7 +218,7 @@ class TestKey:
def test_streaming_response_check_health(self, client: Hanzo) -> None:
with client.key.with_streaming_response.check_health() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(KeyCheckHealthResponse, key, path=["response"])
@@ -269,7 +269,7 @@ class TestKey:
response = client.key.with_raw_response.generate()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(GenerateKeyResponse, key, path=["response"])
@@ -277,7 +277,7 @@ class TestKey:
def test_streaming_response_generate(self, client: Hanzo) -> None:
with client.key.with_streaming_response.generate() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(GenerateKeyResponse, key, path=["response"])
@@ -334,7 +334,7 @@ class TestKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"])
@@ -344,7 +344,7 @@ class TestKey:
path_key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"])
@@ -379,7 +379,7 @@ class TestKey:
response = client.key.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -387,7 +387,7 @@ class TestKey:
def test_streaming_response_retrieve_info(self, client: Hanzo) -> None:
with client.key.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -416,7 +416,7 @@ class TestKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -426,7 +426,7 @@ class TestKey:
key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = response.parse()
assert_matches_type(object, key, path=["response"])
@@ -485,7 +485,7 @@ class TestAsyncKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -495,7 +495,7 @@ class TestAsyncKey:
key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -526,7 +526,7 @@ class TestAsyncKey:
response = await async_client.key.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
@@ -534,7 +534,7 @@ class TestAsyncKey:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.key.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(KeyListResponse, key, path=["response"])
@@ -560,7 +560,7 @@ class TestAsyncKey:
response = await async_client.key.with_raw_response.delete()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -568,7 +568,7 @@ class TestAsyncKey:
async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None:
async with async_client.key.with_streaming_response.delete() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -597,7 +597,7 @@ class TestAsyncKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(Optional[KeyBlockResponse], key, path=["response"])
@@ -607,7 +607,7 @@ class TestAsyncKey:
key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(Optional[KeyBlockResponse], key, path=["response"])
@@ -624,7 +624,7 @@ class TestAsyncKey:
response = await async_client.key.with_raw_response.check_health()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(KeyCheckHealthResponse, key, path=["response"])
@@ -632,7 +632,7 @@ class TestAsyncKey:
async def test_streaming_response_check_health(self, async_client: AsyncHanzo) -> None:
async with async_client.key.with_streaming_response.check_health() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(KeyCheckHealthResponse, key, path=["response"])
@@ -683,7 +683,7 @@ class TestAsyncKey:
response = await async_client.key.with_raw_response.generate()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(GenerateKeyResponse, key, path=["response"])
@@ -691,7 +691,7 @@ class TestAsyncKey:
async def test_streaming_response_generate(self, async_client: AsyncHanzo) -> None:
async with async_client.key.with_streaming_response.generate() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(GenerateKeyResponse, key, path=["response"])
@@ -748,7 +748,7 @@ class TestAsyncKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"])
@@ -758,7 +758,7 @@ class TestAsyncKey:
path_key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"])
@@ -793,7 +793,7 @@ class TestAsyncKey:
response = await async_client.key.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -801,7 +801,7 @@ class TestAsyncKey:
async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None:
async with async_client.key.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -830,7 +830,7 @@ class TestAsyncKey:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
@@ -840,7 +840,7 @@ class TestAsyncKey:
key="key",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
key = await response.parse()
assert_matches_type(object, key, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -40,7 +40,7 @@ class TestLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -71,7 +71,7 @@ class TestLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -81,7 +81,7 @@ class TestLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -112,7 +112,7 @@ class TestLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -122,7 +122,7 @@ class TestLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -153,7 +153,7 @@ class TestLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -163,7 +163,7 @@ class TestLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -194,7 +194,7 @@ class TestLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -204,7 +204,7 @@ class TestLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncLangfuse:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncLangfuse:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
langfuse = await response.parse()
assert_matches_type(object, langfuse, path=["response"])
+8 -8
View File
@@ -87,7 +87,7 @@ class TestModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -99,7 +99,7 @@ class TestModel:
model_name="model_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -120,7 +120,7 @@ class TestModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -130,7 +130,7 @@ class TestModel:
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -211,7 +211,7 @@ class TestAsyncModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -223,7 +223,7 @@ class TestAsyncModel:
model_name="model_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -244,7 +244,7 @@ class TestAsyncModel:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -254,7 +254,7 @@ class TestAsyncModel:
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
+4 -4
View File
@@ -33,7 +33,7 @@ class TestModelGroup:
response = client.model_group.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model_group = response.parse()
assert_matches_type(object, model_group, path=["response"])
@@ -41,7 +41,7 @@ class TestModelGroup:
def test_streaming_response_retrieve_info(self, client: Hanzo) -> None:
with client.model_group.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model_group = response.parse()
assert_matches_type(object, model_group, path=["response"])
@@ -69,7 +69,7 @@ class TestAsyncModelGroup:
response = await async_client.model_group.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model_group = await response.parse()
assert_matches_type(object, model_group, path=["response"])
@@ -77,7 +77,7 @@ class TestAsyncModelGroup:
async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None:
async with async_client.model_group.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model_group = await response.parse()
assert_matches_type(object, model_group, path=["response"])
+4 -4
View File
@@ -34,7 +34,7 @@ class TestModels:
response = client.models.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -42,7 +42,7 @@ class TestModels:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.models.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = response.parse()
assert_matches_type(object, model, path=["response"])
@@ -71,7 +71,7 @@ class TestAsyncModels:
response = await async_client.models.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
@@ -79,7 +79,7 @@ class TestAsyncModels:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.models.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
model = await response.parse()
assert_matches_type(object, model, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestModerations:
response = client.moderations.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
moderation = response.parse()
assert_matches_type(object, moderation, path=["response"])
@@ -34,7 +34,7 @@ class TestModerations:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.moderations.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
moderation = response.parse()
assert_matches_type(object, moderation, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncModerations:
response = await async_client.moderations.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
moderation = await response.parse()
assert_matches_type(object, moderation, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncModerations:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.moderations.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
moderation = await response.parse()
assert_matches_type(object, moderation, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -40,7 +40,7 @@ class TestOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -71,7 +71,7 @@ class TestOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -81,7 +81,7 @@ class TestOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -112,7 +112,7 @@ class TestOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -122,7 +122,7 @@ class TestOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -153,7 +153,7 @@ class TestOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -163,7 +163,7 @@ class TestOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -194,7 +194,7 @@ class TestOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -204,7 +204,7 @@ class TestOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncOpenAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncOpenAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
openai = await response.parse()
assert_matches_type(object, openai, path=["response"])
+28 -28
View File
@@ -56,7 +56,7 @@ class TestOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationCreateResponse, organization, path=["response"])
@@ -66,7 +66,7 @@ class TestOrganization:
organization_alias="organization_alias",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationCreateResponse, organization, path=["response"])
@@ -96,7 +96,7 @@ class TestOrganization:
response = client.organization.with_raw_response.update()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationUpdateResponse, organization, path=["response"])
@@ -104,7 +104,7 @@ class TestOrganization:
def test_streaming_response_update(self, client: Hanzo) -> None:
with client.organization.with_streaming_response.update() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationUpdateResponse, organization, path=["response"])
@@ -121,7 +121,7 @@ class TestOrganization:
response = client.organization.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationListResponse, organization, path=["response"])
@@ -129,7 +129,7 @@ class TestOrganization:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.organization.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationListResponse, organization, path=["response"])
@@ -150,7 +150,7 @@ class TestOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationDeleteResponse, organization, path=["response"])
@@ -160,7 +160,7 @@ class TestOrganization:
organization_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationDeleteResponse, organization, path=["response"])
@@ -198,7 +198,7 @@ class TestOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"])
@@ -209,7 +209,7 @@ class TestOrganization:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"])
@@ -239,7 +239,7 @@ class TestOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(object, organization, path=["response"])
@@ -249,7 +249,7 @@ class TestOrganization:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(object, organization, path=["response"])
@@ -281,7 +281,7 @@ class TestOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"])
@@ -291,7 +291,7 @@ class TestOrganization:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = response.parse()
assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"])
@@ -334,7 +334,7 @@ class TestAsyncOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationCreateResponse, organization, path=["response"])
@@ -344,7 +344,7 @@ class TestAsyncOrganization:
organization_alias="organization_alias",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationCreateResponse, organization, path=["response"])
@@ -374,7 +374,7 @@ class TestAsyncOrganization:
response = await async_client.organization.with_raw_response.update()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationUpdateResponse, organization, path=["response"])
@@ -382,7 +382,7 @@ class TestAsyncOrganization:
async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None:
async with async_client.organization.with_streaming_response.update() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationUpdateResponse, organization, path=["response"])
@@ -399,7 +399,7 @@ class TestAsyncOrganization:
response = await async_client.organization.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationListResponse, organization, path=["response"])
@@ -407,7 +407,7 @@ class TestAsyncOrganization:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.organization.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationListResponse, organization, path=["response"])
@@ -428,7 +428,7 @@ class TestAsyncOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationDeleteResponse, organization, path=["response"])
@@ -438,7 +438,7 @@ class TestAsyncOrganization:
organization_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationDeleteResponse, organization, path=["response"])
@@ -476,7 +476,7 @@ class TestAsyncOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"])
@@ -487,7 +487,7 @@ class TestAsyncOrganization:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"])
@@ -517,7 +517,7 @@ class TestAsyncOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(object, organization, path=["response"])
@@ -527,7 +527,7 @@ class TestAsyncOrganization:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(object, organization, path=["response"])
@@ -559,7 +559,7 @@ class TestAsyncOrganization:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"])
@@ -569,7 +569,7 @@ class TestAsyncOrganization:
organization_id="organization_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
organization = await response.parse()
assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"])
+4 -4
View File
@@ -27,7 +27,7 @@ class TestProvider:
response = client.provider.with_raw_response.list_budgets()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
provider = response.parse()
assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"])
@@ -35,7 +35,7 @@ class TestProvider:
def test_streaming_response_list_budgets(self, client: Hanzo) -> None:
with client.provider.with_streaming_response.list_budgets() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
provider = response.parse()
assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"])
@@ -56,7 +56,7 @@ class TestAsyncProvider:
response = await async_client.provider.with_raw_response.list_budgets()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
provider = await response.parse()
assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"])
@@ -64,7 +64,7 @@ class TestAsyncProvider:
async def test_streaming_response_list_budgets(self, async_client: AsyncHanzo) -> None:
async with async_client.provider.with_streaming_response.list_budgets() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
provider = await response.parse()
assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"])
+12 -12
View File
@@ -26,7 +26,7 @@ class TestRerank:
response = client.rerank.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -34,7 +34,7 @@ class TestRerank:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.rerank.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -51,7 +51,7 @@ class TestRerank:
response = client.rerank.with_raw_response.create_v1()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -59,7 +59,7 @@ class TestRerank:
def test_streaming_response_create_v1(self, client: Hanzo) -> None:
with client.rerank.with_streaming_response.create_v1() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -76,7 +76,7 @@ class TestRerank:
response = client.rerank.with_raw_response.create_v2()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -84,7 +84,7 @@ class TestRerank:
def test_streaming_response_create_v2(self, client: Hanzo) -> None:
with client.rerank.with_streaming_response.create_v2() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -105,7 +105,7 @@ class TestAsyncRerank:
response = await async_client.rerank.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = await response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -113,7 +113,7 @@ class TestAsyncRerank:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.rerank.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = await response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -130,7 +130,7 @@ class TestAsyncRerank:
response = await async_client.rerank.with_raw_response.create_v1()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = await response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -138,7 +138,7 @@ class TestAsyncRerank:
async def test_streaming_response_create_v1(self, async_client: AsyncHanzo) -> None:
async with async_client.rerank.with_streaming_response.create_v1() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = await response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -155,7 +155,7 @@ class TestAsyncRerank:
response = await async_client.rerank.with_raw_response.create_v2()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = await response.parse()
assert_matches_type(object, rerank, path=["response"])
@@ -163,7 +163,7 @@ class TestAsyncRerank:
async def test_streaming_response_create_v2(self, async_client: AsyncHanzo) -> None:
async with async_client.rerank.with_streaming_response.create_v2() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
rerank = await response.parse()
assert_matches_type(object, rerank, path=["response"])
+12 -12
View File
@@ -26,7 +26,7 @@ class TestResponses:
http_response = client.responses.with_raw_response.create()
assert http_response.is_closed is True
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -34,7 +34,7 @@ class TestResponses:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.responses.with_streaming_response.create() as http_response:
assert not http_response.is_closed
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -55,7 +55,7 @@ class TestResponses:
)
assert http_response.is_closed is True
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -65,7 +65,7 @@ class TestResponses:
"response_id",
) as http_response:
assert not http_response.is_closed
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -96,7 +96,7 @@ class TestResponses:
)
assert http_response.is_closed is True
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -106,7 +106,7 @@ class TestResponses:
"response_id",
) as http_response:
assert not http_response.is_closed
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -137,7 +137,7 @@ class TestAsyncResponses:
http_response = await async_client.responses.with_raw_response.create()
assert http_response.is_closed is True
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = await http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -145,7 +145,7 @@ class TestAsyncResponses:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.responses.with_streaming_response.create() as http_response:
assert not http_response.is_closed
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = await http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -166,7 +166,7 @@ class TestAsyncResponses:
)
assert http_response.is_closed is True
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = await http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -176,7 +176,7 @@ class TestAsyncResponses:
"response_id",
) as http_response:
assert not http_response.is_closed
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = await http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -207,7 +207,7 @@ class TestAsyncResponses:
)
assert http_response.is_closed is True
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = await http_response.parse()
assert_matches_type(object, response, path=["response"])
@@ -217,7 +217,7 @@ class TestAsyncResponses:
"response_id",
) as http_response:
assert not http_response.is_closed
assert http_response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert http_response.http_request.headers.get("X-SDK-Lang") == "python"
response = await http_response.parse()
assert_matches_type(object, response, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestRoutes:
response = client.routes.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
route = response.parse()
assert_matches_type(object, route, path=["response"])
@@ -34,7 +34,7 @@ class TestRoutes:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.routes.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
route = response.parse()
assert_matches_type(object, route, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncRoutes:
response = await async_client.routes.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
route = await response.parse()
assert_matches_type(object, route, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncRoutes:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.routes.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
route = await response.parse()
assert_matches_type(object, route, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestSettings:
response = client.settings.with_raw_response.retrieve()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
setting = response.parse()
assert_matches_type(object, setting, path=["response"])
@@ -34,7 +34,7 @@ class TestSettings:
def test_streaming_response_retrieve(self, client: Hanzo) -> None:
with client.settings.with_streaming_response.retrieve() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
setting = response.parse()
assert_matches_type(object, setting, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncSettings:
response = await async_client.settings.with_raw_response.retrieve()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
setting = await response.parse()
assert_matches_type(object, setting, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncSettings:
async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None:
async with async_client.settings.with_streaming_response.retrieve() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
setting = await response.parse()
assert_matches_type(object, setting, path=["response"])
+12 -12
View File
@@ -39,7 +39,7 @@ class TestSpend:
response = client.spend.with_raw_response.calculate_spend()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -47,7 +47,7 @@ class TestSpend:
def test_streaming_response_calculate_spend(self, client: Hanzo) -> None:
with client.spend.with_streaming_response.calculate_spend() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -75,7 +75,7 @@ class TestSpend:
response = client.spend.with_raw_response.list_logs()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendListLogsResponse, spend, path=["response"])
@@ -83,7 +83,7 @@ class TestSpend:
def test_streaming_response_list_logs(self, client: Hanzo) -> None:
with client.spend.with_streaming_response.list_logs() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendListLogsResponse, spend, path=["response"])
@@ -108,7 +108,7 @@ class TestSpend:
response = client.spend.with_raw_response.list_tags()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -116,7 +116,7 @@ class TestSpend:
def test_streaming_response_list_tags(self, client: Hanzo) -> None:
with client.spend.with_streaming_response.list_tags() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -146,7 +146,7 @@ class TestAsyncSpend:
response = await async_client.spend.with_raw_response.calculate_spend()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -154,7 +154,7 @@ class TestAsyncSpend:
async def test_streaming_response_calculate_spend(self, async_client: AsyncHanzo) -> None:
async with async_client.spend.with_streaming_response.calculate_spend() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(object, spend, path=["response"])
@@ -182,7 +182,7 @@ class TestAsyncSpend:
response = await async_client.spend.with_raw_response.list_logs()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendListLogsResponse, spend, path=["response"])
@@ -190,7 +190,7 @@ class TestAsyncSpend:
async def test_streaming_response_list_logs(self, async_client: AsyncHanzo) -> None:
async with async_client.spend.with_streaming_response.list_logs() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendListLogsResponse, spend, path=["response"])
@@ -215,7 +215,7 @@ class TestAsyncSpend:
response = await async_client.spend.with_raw_response.list_tags()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
@@ -223,7 +223,7 @@ class TestAsyncSpend:
async def test_streaming_response_list_tags(self, async_client: AsyncHanzo) -> None:
async with async_client.spend.with_streaming_response.list_tags() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
spend = await response.parse()
assert_matches_type(SpendListTagsResponse, spend, path=["response"])
+48 -48
View File
@@ -60,7 +60,7 @@ class TestTeam:
response = client.team.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(HanzoTeamTable, team, path=["response"])
@@ -68,7 +68,7 @@ class TestTeam:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.team.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(HanzoTeamTable, team, path=["response"])
@@ -109,7 +109,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -119,7 +119,7 @@ class TestTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -144,7 +144,7 @@ class TestTeam:
response = client.team.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -152,7 +152,7 @@ class TestTeam:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.team.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -181,7 +181,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -191,7 +191,7 @@ class TestTeam:
team_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -229,7 +229,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(TeamAddMemberResponse, team, path=["response"])
@@ -240,7 +240,7 @@ class TestTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(TeamAddMemberResponse, team, path=["response"])
@@ -261,7 +261,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -271,7 +271,7 @@ class TestTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -292,7 +292,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -302,7 +302,7 @@ class TestTeam:
"team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -336,7 +336,7 @@ class TestTeam:
response = client.team.with_raw_response.list_available()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -344,7 +344,7 @@ class TestTeam:
def test_streaming_response_list_available(self, client: Hanzo) -> None:
with client.team.with_streaming_response.list_available() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -374,7 +374,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -384,7 +384,7 @@ class TestTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -408,7 +408,7 @@ class TestTeam:
response = client.team.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -416,7 +416,7 @@ class TestTeam:
def test_streaming_response_retrieve_info(self, client: Hanzo) -> None:
with client.team.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -437,7 +437,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -447,7 +447,7 @@ class TestTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(object, team, path=["response"])
@@ -479,7 +479,7 @@ class TestTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(TeamUpdateMemberResponse, team, path=["response"])
@@ -489,7 +489,7 @@ class TestTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = response.parse()
assert_matches_type(TeamUpdateMemberResponse, team, path=["response"])
@@ -539,7 +539,7 @@ class TestAsyncTeam:
response = await async_client.team.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(HanzoTeamTable, team, path=["response"])
@@ -547,7 +547,7 @@ class TestAsyncTeam:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.team.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(HanzoTeamTable, team, path=["response"])
@@ -588,7 +588,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -598,7 +598,7 @@ class TestAsyncTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -623,7 +623,7 @@ class TestAsyncTeam:
response = await async_client.team.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -631,7 +631,7 @@ class TestAsyncTeam:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.team.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -660,7 +660,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -670,7 +670,7 @@ class TestAsyncTeam:
team_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -708,7 +708,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(TeamAddMemberResponse, team, path=["response"])
@@ -719,7 +719,7 @@ class TestAsyncTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(TeamAddMemberResponse, team, path=["response"])
@@ -740,7 +740,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -750,7 +750,7 @@ class TestAsyncTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -771,7 +771,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -781,7 +781,7 @@ class TestAsyncTeam:
"team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -815,7 +815,7 @@ class TestAsyncTeam:
response = await async_client.team.with_raw_response.list_available()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -823,7 +823,7 @@ class TestAsyncTeam:
async def test_streaming_response_list_available(self, async_client: AsyncHanzo) -> None:
async with async_client.team.with_streaming_response.list_available() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -853,7 +853,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -863,7 +863,7 @@ class TestAsyncTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -887,7 +887,7 @@ class TestAsyncTeam:
response = await async_client.team.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -895,7 +895,7 @@ class TestAsyncTeam:
async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None:
async with async_client.team.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -916,7 +916,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -926,7 +926,7 @@ class TestAsyncTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(object, team, path=["response"])
@@ -958,7 +958,7 @@ class TestAsyncTeam:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(TeamUpdateMemberResponse, team, path=["response"])
@@ -968,7 +968,7 @@ class TestAsyncTeam:
team_id="team_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
team = await response.parse()
assert_matches_type(TeamUpdateMemberResponse, team, path=["response"])
+4 -4
View File
@@ -26,7 +26,7 @@ class TestTest:
response = client.test.with_raw_response.ping()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
test = response.parse()
assert_matches_type(object, test, path=["response"])
@@ -34,7 +34,7 @@ class TestTest:
def test_streaming_response_ping(self, client: Hanzo) -> None:
with client.test.with_streaming_response.ping() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
test = response.parse()
assert_matches_type(object, test, path=["response"])
@@ -55,7 +55,7 @@ class TestAsyncTest:
response = await async_client.test.with_raw_response.ping()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
test = await response.parse()
assert_matches_type(object, test, path=["response"])
@@ -63,7 +63,7 @@ class TestAsyncTest:
async def test_streaming_response_ping(self, async_client: AsyncHanzo) -> None:
async with async_client.test.with_streaming_response.ping() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
test = await response.parse()
assert_matches_type(object, test, path=["response"])
+8 -8
View File
@@ -26,7 +26,7 @@ class TestThreads:
response = client.threads.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -34,7 +34,7 @@ class TestThreads:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.threads.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -55,7 +55,7 @@ class TestThreads:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -65,7 +65,7 @@ class TestThreads:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -96,7 +96,7 @@ class TestAsyncThreads:
response = await async_client.threads.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = await response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -104,7 +104,7 @@ class TestAsyncThreads:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.threads.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = await response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -125,7 +125,7 @@ class TestAsyncThreads:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = await response.parse()
assert_matches_type(object, thread, path=["response"])
@@ -135,7 +135,7 @@ class TestAsyncThreads:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
thread = await response.parse()
assert_matches_type(object, thread, path=["response"])
+20 -20
View File
@@ -62,7 +62,7 @@ class TestUser:
response = client.user.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(UserCreateResponse, user, path=["response"])
@@ -70,7 +70,7 @@ class TestUser:
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.user.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(UserCreateResponse, user, path=["response"])
@@ -117,7 +117,7 @@ class TestUser:
response = client.user.with_raw_response.update()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -125,7 +125,7 @@ class TestUser:
def test_streaming_response_update(self, client: Hanzo) -> None:
with client.user.with_streaming_response.update() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -152,7 +152,7 @@ class TestUser:
response = client.user.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -160,7 +160,7 @@ class TestUser:
def test_streaming_response_list(self, client: Hanzo) -> None:
with client.user.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -189,7 +189,7 @@ class TestUser:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -199,7 +199,7 @@ class TestUser:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -223,7 +223,7 @@ class TestUser:
response = client.user.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -231,7 +231,7 @@ class TestUser:
def test_streaming_response_retrieve_info(self, client: Hanzo) -> None:
with client.user.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = response.parse()
assert_matches_type(object, user, path=["response"])
@@ -285,7 +285,7 @@ class TestAsyncUser:
response = await async_client.user.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(UserCreateResponse, user, path=["response"])
@@ -293,7 +293,7 @@ class TestAsyncUser:
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.user.with_streaming_response.create() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(UserCreateResponse, user, path=["response"])
@@ -340,7 +340,7 @@ class TestAsyncUser:
response = await async_client.user.with_raw_response.update()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -348,7 +348,7 @@ class TestAsyncUser:
async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None:
async with async_client.user.with_streaming_response.update() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -375,7 +375,7 @@ class TestAsyncUser:
response = await async_client.user.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -383,7 +383,7 @@ class TestAsyncUser:
async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None:
async with async_client.user.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -412,7 +412,7 @@ class TestAsyncUser:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -422,7 +422,7 @@ class TestAsyncUser:
user_ids=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -446,7 +446,7 @@ class TestAsyncUser:
response = await async_client.user.with_raw_response.retrieve_info()
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
@@ -454,7 +454,7 @@ class TestAsyncUser:
async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None:
async with async_client.user.with_streaming_response.retrieve_info() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
user = await response.parse()
assert_matches_type(object, user, path=["response"])
+12 -12
View File
@@ -34,7 +34,7 @@ class TestUtils:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = response.parse()
assert_matches_type(object, util, path=["response"])
@@ -44,7 +44,7 @@ class TestUtils:
model="model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = response.parse()
assert_matches_type(object, util, path=["response"])
@@ -74,7 +74,7 @@ class TestUtils:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = response.parse()
assert_matches_type(UtilTokenCounterResponse, util, path=["response"])
@@ -84,7 +84,7 @@ class TestUtils:
model="model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = response.parse()
assert_matches_type(UtilTokenCounterResponse, util, path=["response"])
@@ -107,7 +107,7 @@ class TestUtils:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = response.parse()
assert_matches_type(UtilTransformRequestResponse, util, path=["response"])
@@ -118,7 +118,7 @@ class TestUtils:
request_body={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = response.parse()
assert_matches_type(UtilTransformRequestResponse, util, path=["response"])
@@ -143,7 +143,7 @@ class TestAsyncUtils:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = await response.parse()
assert_matches_type(object, util, path=["response"])
@@ -153,7 +153,7 @@ class TestAsyncUtils:
model="model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = await response.parse()
assert_matches_type(object, util, path=["response"])
@@ -183,7 +183,7 @@ class TestAsyncUtils:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = await response.parse()
assert_matches_type(UtilTokenCounterResponse, util, path=["response"])
@@ -193,7 +193,7 @@ class TestAsyncUtils:
model="model",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = await response.parse()
assert_matches_type(UtilTokenCounterResponse, util, path=["response"])
@@ -216,7 +216,7 @@ class TestAsyncUtils:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = await response.parse()
assert_matches_type(UtilTransformRequestResponse, util, path=["response"])
@@ -227,7 +227,7 @@ class TestAsyncUtils:
request_body={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
util = await response.parse()
assert_matches_type(UtilTransformRequestResponse, util, path=["response"])
+20 -20
View File
@@ -30,7 +30,7 @@ class TestVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -40,7 +40,7 @@ class TestVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -71,7 +71,7 @@ class TestVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -81,7 +81,7 @@ class TestVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -112,7 +112,7 @@ class TestVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -122,7 +122,7 @@ class TestVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -153,7 +153,7 @@ class TestVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -163,7 +163,7 @@ class TestVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -194,7 +194,7 @@ class TestVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -204,7 +204,7 @@ class TestVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -239,7 +239,7 @@ class TestAsyncVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -249,7 +249,7 @@ class TestAsyncVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -280,7 +280,7 @@ class TestAsyncVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -290,7 +290,7 @@ class TestAsyncVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -321,7 +321,7 @@ class TestAsyncVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -331,7 +331,7 @@ class TestAsyncVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -362,7 +362,7 @@ class TestAsyncVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -372,7 +372,7 @@ class TestAsyncVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -403,7 +403,7 @@ class TestAsyncVertexAI:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
@@ -413,7 +413,7 @@ class TestAsyncVertexAI:
"endpoint",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
vertex_ai = await response.parse()
assert_matches_type(object, vertex_ai, path=["response"])
+8 -8
View File
@@ -30,7 +30,7 @@ class TestMessages:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = response.parse()
assert_matches_type(object, message, path=["response"])
@@ -40,7 +40,7 @@ class TestMessages:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = response.parse()
assert_matches_type(object, message, path=["response"])
@@ -71,7 +71,7 @@ class TestMessages:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = response.parse()
assert_matches_type(object, message, path=["response"])
@@ -81,7 +81,7 @@ class TestMessages:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = response.parse()
assert_matches_type(object, message, path=["response"])
@@ -116,7 +116,7 @@ class TestAsyncMessages:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = await response.parse()
assert_matches_type(object, message, path=["response"])
@@ -126,7 +126,7 @@ class TestAsyncMessages:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = await response.parse()
assert_matches_type(object, message, path=["response"])
@@ -157,7 +157,7 @@ class TestAsyncMessages:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = await response.parse()
assert_matches_type(object, message, path=["response"])
@@ -167,7 +167,7 @@ class TestAsyncMessages:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
message = await response.parse()
assert_matches_type(object, message, path=["response"])
+4 -4
View File
@@ -30,7 +30,7 @@ class TestRuns:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
run = response.parse()
assert_matches_type(object, run, path=["response"])
@@ -40,7 +40,7 @@ class TestRuns:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
run = response.parse()
assert_matches_type(object, run, path=["response"])
@@ -75,7 +75,7 @@ class TestAsyncRuns:
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
run = await response.parse()
assert_matches_type(object, run, path=["response"])
@@ -85,7 +85,7 @@ class TestAsyncRuns:
"thread_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Hanzo-Lang") == "python"
assert response.http_request.headers.get("X-SDK-Lang") == "python"
run = await response.parse()
assert_matches_type(object, run, path=["response"])
+16 -16
View File
@@ -352,7 +352,7 @@ class TestHanzo:
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-hanzo-lang") == "python"
assert request.headers.get("x-sdk-lang") == "python"
client2 = Hanzo(
base_url=base_url,
@@ -360,12 +360,12 @@ class TestHanzo:
_strict_response_validation=True,
default_headers={
"X-Foo": "stainless",
"X-Hanzo-Lang": "my-overriding-header",
"X-SDK-Lang": "my-overriding-header",
},
)
request = client2._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-hanzo-lang") == "my-overriding-header"
assert request.headers.get("x-sdk-lang") == "my-overriding-header"
def test_validate_headers(self) -> None:
client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True)
@@ -840,7 +840,7 @@ class TestHanzo:
response = client.with_raw_response.get_home()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-hanzo-retry-count")) == failures_before_success
assert int(response.http_request.headers.get("x-sdk-retry-count")) == failures_before_success
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@@ -859,9 +859,9 @@ class TestHanzo:
respx_mock.get("/").mock(side_effect=retry_handler)
response = client.with_raw_response.get_home(extra_headers={"x-hanzo-retry-count": Omit()})
response = client.with_raw_response.get_home(extra_headers={"x-sdk-retry-count": Omit()})
assert len(response.http_request.headers.get_list("x-hanzo-retry-count")) == 0
assert len(response.http_request.headers.get_list("x-sdk-retry-count")) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@@ -882,9 +882,9 @@ class TestHanzo:
respx_mock.get("/").mock(side_effect=retry_handler)
response = client.with_raw_response.get_home(extra_headers={"x-hanzo-retry-count": "42"})
response = client.with_raw_response.get_home(extra_headers={"x-sdk-retry-count": "42"})
assert response.http_request.headers.get("x-hanzo-retry-count") == "42"
assert response.http_request.headers.get("x-sdk-retry-count") == "42"
class TestAsyncHanzo:
@@ -1179,7 +1179,7 @@ class TestAsyncHanzo:
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-hanzo-lang") == "python"
assert request.headers.get("x-sdk-lang") == "python"
client2 = AsyncHanzo(
base_url=base_url,
@@ -1187,12 +1187,12 @@ class TestAsyncHanzo:
_strict_response_validation=True,
default_headers={
"X-Foo": "stainless",
"X-Hanzo-Lang": "my-overriding-header",
"X-SDK-Lang": "my-overriding-header",
},
)
request = client2._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-hanzo-lang") == "my-overriding-header"
assert request.headers.get("x-sdk-lang") == "my-overriding-header"
def test_validate_headers(self) -> None:
client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True)
@@ -1672,7 +1672,7 @@ class TestAsyncHanzo:
response = await client.with_raw_response.get_home()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-hanzo-retry-count")) == failures_before_success
assert int(response.http_request.headers.get("x-sdk-retry-count")) == failures_before_success
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@@ -1697,9 +1697,9 @@ class TestAsyncHanzo:
respx_mock.get("/").mock(side_effect=retry_handler)
response = await client.with_raw_response.get_home(extra_headers={"x-hanzo-retry-count": Omit()})
response = await client.with_raw_response.get_home(extra_headers={"x-sdk-retry-count": Omit()})
assert len(response.http_request.headers.get_list("x-hanzo-retry-count")) == 0
assert len(response.http_request.headers.get_list("x-sdk-retry-count")) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@@ -1724,9 +1724,9 @@ class TestAsyncHanzo:
respx_mock.get("/").mock(side_effect=retry_handler)
response = await client.with_raw_response.get_home(extra_headers={"x-hanzo-retry-count": "42"})
response = await client.with_raw_response.get_home(extra_headers={"x-sdk-retry-count": "42"})
assert response.http_request.headers.get("x-hanzo-retry-count") == "42"
assert response.http_request.headers.get("x-sdk-retry-count") == "42"
def test_get_platform(self) -> None:
# A previous implementation of asyncify could leave threads unterminated when