Skip to main content

An in-process, schema-driven, zero-dependency AWS auto-mocking engine for Python developers

Project description

⚡ MockMesh

An in-process, schema-driven, zero-container AWS auto-mocking library for Python developers. Run integration tests across 420+ AWS services in milliseconds with 0MB Docker overhead.

🚀 Why MockMesh?

  • Sub-Second Feedback Loop: Run full AWS lifecycles in milliseconds instead of waiting for heavy containers to boot.
  • 426 AWS Services Out-of-the-Box: Powered by a recursive compiler engine that reads botocore JSON schemas natively to auto-generate contextually realistic responses (ARNs, UUIDs, ISO timestamps) for unmapped services.
  • Three-Tier Routing: High-fidelity stateful handlers (S3/DynamoDB) take priority ➔ Auto-Mock compiler covers the rest ➔ Real AWS passthrough as a last resort.
  • Hybrid Caching: Stores metadata in lightning-fast in-memory SQLite tables, while streaming massive binary payloads directly to a local file cache to prevent RAM saturation.
  • Standalone Server: Run mockmesh start to launch a language-agnostic HTTP server on port 4566 with a premium dark-mode Developer Console.

🛠️ Quick Start

pip install mockmesh

Python In-Process (Sub-Second Offline Tests)

import boto3
import mockmesh

# Use as a global switch or a scoped context manager
with mockmesh.mockmesh():
    # 1. High-Fidelity Stateful S3 Handler (Hybrid Local Cache)
    s3 = boto3.client('s3', region_name='us-east-1')
    s3.create_bucket(Bucket="media-pipeline")
    s3.put_object(Bucket="media-pipeline", Key="vid.mp4", Body=b"binary_stream")

    # 2. Schema-Driven Auto-Mock (SQS, Lambda, Secrets Manager, etc.)
    sqs = boto3.client('sqs', region_name='us-east-1')
    response = sqs.create_queue(QueueName="orders-queue")
    print(response) # Auto-generates a perfectly structured QueueUrl and Metadata!

Standalone Server (For Node.js, Go, or CLI Scripts)

# Start MockMesh on port 4566
mockmesh start --port 4566

# Connect from any AWS SDK or CLI
aws s3api create-bucket --bucket dev-bucket --endpoint-url http://localhost:4566

Open http://localhost:4566/dashboard to inspect your local state visually.

🏗️ Architecture

Developer's boto3 call
        │
        ▼
[1] Hand-coded handlers (S3, DynamoDB) → Stateful, high-fidelity, 21 operations
        │ (if unmapped)
        ▼
[2] Auto-Mock Schema Compiler → Reads botocore JSON, covers 426 services
        │ (if service not found)
        ▼
[3] Real AWS passthrough → Last resort

📊 Supported Operations

S3 (Stateful — Full Lifecycle)

CreateBucket · PutObject · GetObject · DeleteObject · ListObjectsV2 · CopyObject · DeleteObjects · ListBuckets · HeadObject · HeadBucket

DynamoDB (Stateful — Full Lifecycle)

CreateTable · PutItem · GetItem · DeleteItem · Query · Scan · ListTables · UpdateItem · BatchWriteItem · BatchGetItem · DescribeTable · DeleteTable

Everything Else (Auto-Mock Compiler)

SQS · SNS · Lambda · STS · Secrets Manager · KMS · IAM · CloudWatch · EventBridge · Step Functions · and 416 more — all auto-generated from botocore's native JSON schemas at runtime.

🧹 Cache Maintenance

import mockmesh
mockmesh.clean()

🧪 Testing

PYTHONPATH=. pytest tests/ -s -v
# 25 passed in 7.70s

📄 License

Distributed under the MIT License. Built entirely for free by Aman Kumar.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mockmesh_aws-0.2.0.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mockmesh_aws-0.2.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file mockmesh_aws-0.2.0.tar.gz.

File metadata

  • Download URL: mockmesh_aws-0.2.0.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mockmesh_aws-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d322f51bf7e318816229f1efbb983d7b89653db6a9036955fb2e9c2832bd9634
MD5 e27592d7b37461394350166d28c75963
BLAKE2b-256 62ba4404fae1e2b611130d5b799986ff46e10dbc5eb21afcb875fd8adf292df0

See more details on using hashes here.

File details

Details for the file mockmesh_aws-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mockmesh_aws-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mockmesh_aws-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b57372153028ab5051e80c8a2948549da1b21b0fe6466d7ceb19c7ae36b6776
MD5 05bbb6d234c7efb7f9c5f2c1de752229
BLAKE2b-256 aa60b7e0af4a1f9bc5378adfb5c2063e8ed13051b5f90edc9ae61579a999daeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page