Skip to main content

smithy-http

This package provides primitives and interfaces for http functionality in tooling generated by Smithy.


Testing

The smithy_http.testing module provides shared utilities for testing HTTP functionality in smithy-python clients.

MockHTTPClient

MockHTTPClient lets you test smithy-python clients without making actual network calls. It implements the HTTPClient interface and returns queued responses. For async clients, use smithy_http.aio.testing.AsyncMockHTTPClient, which implements AsyncHTTPClient the same way.

Basic Usage

from smithy_http.testing import MockHTTPClient

# Create mock client and configure responses
mock_client = MockHTTPClient()
mock_client.add_response(
   status=200,
   headers=[("Content-Type", "application/json")],
   body=b'{"message": "success"}'
)

# Use with your smithy-python client
config = Config(transport=mock_client)
client = TestSmithyServiceClient(config=config)

# Test your client logic
result = client.some_operation({"input": "data"})

# Inspect what requests were made
assert mock_client.call_count == 1
captured_request = mock_client.captured_requests[0]
assert result.message == "success"

Utilities

  • create_test_request(): Helper for creating test HTTPRequest objects
  • MockHTTPClientError: Exception raised when no responses are queued

Metadata

Release files for smithy-http 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smithy-http 0.8.0
File Size Uploaded Provenance Actions
smithy_http-0.8.0.tar.gz 53.1 kB Without provenance Details for smithy_http-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smithy-http 0.8.0
File Interpreter ABI Platform Actions
smithy_http-0.8.0-py3-none-any.whl Python 3 none any Details for smithy_http-0.8.0-py3-none-any.whl

Total release size: 119.9 kB

Release files / smithy_http-0.8.0.tar.gz

Download URL smithy_http-0.8.0.tar.gz
Size 53.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5e17627e56587499dadada5e0212674d3eee8420783dbf8b4d93b36258c88713
BLAKE2b-256 checksum
How to use checksums
0ac38156f8cff97f612c43b61b1eb1ccc1f32d89af59da0463da8567238bac0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / smithy_http-0.8.0-py3-none-any.whl

Download URL smithy_http-0.8.0-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7663db9d1102aacff9430d33b6a8b7d840b13c6cb8b22b336cd4a53007b86c22
BLAKE2b-256 checksum
How to use checksums
189d0ae37efd2fd894c3b99dea0fdda8fa957245f2cc416b58b43468fbb8a42b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for smithy-http 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page