Metadata-Version: 2.5
Name: hookhappens
Version: 0.1.0
Summary: The Python client and pytest plugin for HookHappens, the webhook and API mock for testing at hookhappens.com.
Project-URL: Homepage, https://hookhappens.com
Project-URL: Documentation, https://hookhappens.com/#/how-to/testing
License-Expression: LicenseRef-Proprietary
Keywords: api,mock,pytest,testing,webhook
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Testing :: Mocking
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# HookHappens, the Python client

**HookHappens** ("Mock around & find out") stands in for the endpoints your system calls, or
sits in front of the real ones. A test changes exactly the part of the answer it needs, and you
see what your system did with it. The service lives at **https://hookhappens.com**; this package
is the Python client and the pytest plugin for it.

```bash
pip install hookhappens
```

```python
from hookhappens import HookHappens

with HookHappens("https://hookhappens.com", api_key="hh_…") as hh:
    with hh.new_namespace("snack-bar") as run:         # a throwaway address for this test run
        run.rule("order-snack", then=[{"status": 503}])  # the kitchen is on fire
        my_app.order("cookie", 3, kitchen=run.url)       # point your system at it
        call = run.wait_for("order-snack")               # the call your system made, with its answer
        assert call.status == 503
```

With pytest, the `hh` fixture does the same with no setup beyond two environment variables:

```bash
export HOOKHAPPENS_URL=https://hookhappens.com
export HOOKHAPPENS_API_KEY=hh_…
pytest
```

```python
def test_the_kitchen_on_fire(hh):
    hh.scenario_on("kitchen-on-fire")
    my_app.order("cookie", 3, kitchen=hh.url)
    assert hh.wait_for(endpoint="order-snack").status == 503
```

The whole story, with a runnable example app and its test suite, is the **Testing your system**
guide: https://hookhappens.com/#/how-to/testing. The service is hosted only; nothing to install
but this client. © 2026 Carolina Shulman Grigoriev. All rights reserved.
