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.9.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.9.0
File Size Uploaded Provenance Actions
smithy_http-0.9.0.tar.gz 53.2 kB Without provenance Details for smithy_http-0.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 120.0 kB

Release files / smithy_http-0.9.0.tar.gz

Download URL smithy_http-0.9.0.tar.gz
Size 53.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fc4fd51bed16e794f0bd47b244ae3d8ee3ae192afd015f84b4987bc4008f4509
BLAKE2b-256 checksum
How to use checksums
7585a7e4b012dd8f57fc8fb10f4502f6a5e081dce49fbdbc7d3b88d4c1f42495
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.9.0-py3-none-any.whl

Download URL smithy_http-0.9.0-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d8e2890955cf0bbd170179dffa47fd95ab8019fcb3e9a7121cc6f28aef0e538
BLAKE2b-256 checksum
How to use checksums
b7e0c806826f728bc5b0b7594cc90657c66a62b981873a766ff3afe70181b813
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.9.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