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.10.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.10.0
File Size Uploaded Provenance Actions
smithy_http-0.10.0.tar.gz 54.4 kB Without provenance Details for smithy_http-0.10.0.tar.gz

Built distribution (wheel)

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

Total release size: 121.5 kB

Release files / smithy_http-0.10.0.tar.gz

Download URL smithy_http-0.10.0.tar.gz
Size 54.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b8575151edfced82bb8ab5e39eada2e9dcad3adfe1ab9f01b5b7393775ea028e
BLAKE2b-256 checksum
How to use checksums
d036f23546a89396866abefa0842422bdec764b2c9bcd9efbf47a21feecc95bd
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.10.0-py3-none-any.whl

Download URL smithy_http-0.10.0-py3-none-any.whl
Size 67.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7935c5337d349743b46e6624f4005a517815e7c5e553ce8b513da1d178e0abac
BLAKE2b-256 checksum
How to use checksums
6e948e9e8b347104bfb692222e46ce39b71d4969e941aac5ded9a266b23c45a3
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.10.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