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

The MockHTTPClient allows you to test smithy-python clients without making actual network calls. It implements the HTTPClient interface and provides configurable responses for functional testing.

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 = await 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

Release files for smithy-http 0.5.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.5.0
File Size Uploaded
smithy_http-0.5.0.tar.gz 31.1 kB Details

Built distribution (wheel)

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

Total release size: 73.3 kB

Release files / smithy_http-0.5.0.tar.gz

Download URL smithy_http-0.5.0.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb4a19672f7c7eeb872a308f777eb505281a5bafb1ee3d1ea9c760c06c352510
BLAKE2b-256 checksum
How to use checksums
9878b5f3113d6c8f0bc1f9777a7f5ca84b892d29efac05850e14f7d4f7e645b5
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.5.0-py3-none-any.whl

Download URL smithy_http-0.5.0-py3-none-any.whl
Size 42.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af273d5f42e7733ce7a6e9bd6fdd6a59ef1b61f6cd1f4a89dd53dfce99da7bef
BLAKE2b-256 checksum
How to use checksums
2727e414082643028846b73afa52a1a8f934548196ee12b187a06803f02a3e66
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 history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

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