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.7.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.7.0
File Size Uploaded Provenance Actions
smithy_http-0.7.0.tar.gz 48.2 kB Without provenance Details for smithy_http-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 111.1 kB

Release files / smithy_http-0.7.0.tar.gz

Download URL smithy_http-0.7.0.tar.gz
Size 48.2 kB
Tags Source
SHA-256 checksum
How to use checksums
44b0a0eb29eb4b236889a807baf4c48862f8bc4ceb2ebe2e9a58cb1abeaa795d
BLAKE2b-256 checksum
How to use checksums
bb546631c7933e51e1f42b5910f861dd136d5a06327c7d918d54f0f7ad02ab8a
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.7.0-py3-none-any.whl

Download URL smithy_http-0.7.0-py3-none-any.whl
Size 62.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48884847d02e4ebd70e2a192a6032250da8f75ed23efafaf6ef187eb20682a00
BLAKE2b-256 checksum
How to use checksums
90050deefa122a9cb9393248d11def783e091523c36b034b46ac284aa3605609
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.7.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