Skip to main content

Shared test utilities for Kernia

Project description

kernia-test-utils

Shared test utilities for Kernia: an ASGI driver, mock OIDC/SAML identity providers, SMTP/SMS capture, a Stripe REST mock, a software WebAuthn authenticator, and lazy testcontainers fixtures.

Part of Kernia, a framework-agnostic authentication library for Python.

Installation

pip install kernia-test-utils

Usage

from kernia_test_utils import ASGIDriver, MockSMTP

# Drive an ASGI app like an HTTP client, no server needed.
driver = ASGIDriver(app=auth.router.mount())
response = await driver.post("/api/auth/sign-up/email", json={
    "email": "user@example.com",
    "password": "correct-horse",
    "name": "User",
})

# Capture outgoing email in tests.
smtp = MockSMTP()

Also provides MockIdP, MockSAMLIdP, MockStripe, MockSMS, SoftAuthenticator, and container fixtures behind requires_docker.

Documentation

Full documentation at kernia.dev/docs. Source at github.com/advantch/kernia.

License

MIT

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

kernia_test_utils-0.1.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

kernia_test_utils-0.1.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file kernia_test_utils-0.1.0.tar.gz.

File metadata

  • Download URL: kernia_test_utils-0.1.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kernia_test_utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f90ac241f76a6c7956f77f1429d8184e527f81505c02349c5788967a738db04
MD5 351d74869cd651c5a9a50b3bda53c90a
BLAKE2b-256 c40b6633b513766ee2635572ad4414c523d8ad665f11dd48e3ec4c89890664e8

See more details on using hashes here.

File details

Details for the file kernia_test_utils-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kernia_test_utils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kernia_test_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 652205d5aec6929ecf293d85ea65d4e3f5daf0cace5ed63185d72fb0e3baf2fa
MD5 3588eaa8722fde738f937a6d8c8b21ef
BLAKE2b-256 0654384f6c85d5c262f14eaf281caf58266d9f7a38c24b7c5ba10a0d247ef473

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