Skip to main content

Testcontainers module for AT Protocol PDS integration testing

Project description

testcontainers-atproto

tests codecov publish

Spin up ephemeral PDS instances in your Python test suite. Lexicon-agnostic — works with any application built on AT Protocol, not just Bluesky.


Installation

pip install testcontainers-atproto

Requires Python 3.10+ and a running Docker daemon.

Extras

Extra What it adds
testcontainers-atproto[firehose] websockets, cbor2 for firehose subscription
testcontainers-atproto[sdk] atproto (MarshalX SDK) for high-level record ops
testcontainers-atproto[all] Both of the above

Quick start

from testcontainers_atproto import PDSContainer

with PDSContainer() as pds:
    account = pds.create_account("alice.test")
    print(pds.base_url)       # http://localhost:<port>
    print(account.did)         # did:plc:...
    print(account.handle)      # alice.test

Pytest fixtures

After installing the package, these fixtures are available automatically via the pytest11 entry point:

Fixture Scope Description
pds function Fresh PDS instance per test
pds_module module Shared PDS instance within a test module
pds_pair function Two PDS instances for federation testing
pds_image session PDS image tag (override via ATP_PDS_IMAGE env var)
def test_create_account(pds):
    account = pds.create_account("bob.test")
    assert account.did.startswith("did:plc:")

Development

make venv                                       # Create virtual environment
source .testcontainers-atproto-3.12/bin/activate # Activate
make test                                        # Run tests
make test-all                                    # Run across all supported Python versions

License

Apache-2.0. See LICENSE.

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

testcontainers_atproto-0.0.0.tar.gz (122.0 kB view details)

Uploaded Source

Built Distribution

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

testcontainers_atproto-0.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file testcontainers_atproto-0.0.0.tar.gz.

File metadata

  • Download URL: testcontainers_atproto-0.0.0.tar.gz
  • Upload date:
  • Size: 122.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for testcontainers_atproto-0.0.0.tar.gz
Algorithm Hash digest
SHA256 a28def7805e6b2d43fb1cdf7266b868cbcd3c5ee66ae5008799f955c4afad6f5
MD5 6943e9de5e2292d2c45b056bd3ae4413
BLAKE2b-256 44cba3e466e551c4aec335a9bdc4f1ce2d071ab0a350c94fd14ed8d2bb657143

See more details on using hashes here.

File details

Details for the file testcontainers_atproto-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for testcontainers_atproto-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1098828de1b4f380029b5fb304f5e600a8d8e5c09044af900a936eb905160024
MD5 681324e4d4471258c050b828d232af91
BLAKE2b-256 faff289cc1863c6bb5e06296a5eae0c9bb5d43dcd8f2efe71fd5df4e17f44c69

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