Metadata-Version: 2.4
Name: kernia-test-utils
Version: 0.1.0
Summary: Shared test utilities for Kernia
Project-URL: Homepage, https://kernia.dev
Project-URL: Documentation, https://kernia.dev/docs
Project-URL: Source, https://github.com/advantch/kernia
Project-URL: Issues, https://github.com/advantch/kernia/issues
Project-URL: Changelog, https://github.com/advantch/kernia/releases
Author: Advantch
License-Expression: MIT
License-File: LICENSE
Keywords: asgi,authentication,authorization,django,fastapi,oauth,passkeys,security,sessions,sso,starlette
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: Session
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: cbor2>=5
Requires-Dist: cryptography>=42
Requires-Dist: httpx>=0.27
Requires-Dist: kernia>=0.1.0
Requires-Dist: lxml>=5
Requires-Dist: webauthn>=2.7
Provides-Extra: pytest
Requires-Dist: pytest>=8; extra == 'pytest'
Provides-Extra: testcontainers
Requires-Dist: testcontainers>=4; extra == 'testcontainers'
Description-Content-Type: text/markdown

# 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](https://kernia.dev), a framework-agnostic authentication library for Python.

## Installation

    pip install kernia-test-utils

## Usage

```python
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](https://kernia.dev/docs). Source at [github.com/advantch/kernia](https://github.com/advantch/kernia).

## License

MIT
