---
question: How do I test that a module loads on NATS?
kind: guide
---

# Test a module

Test a workflow's `run(...)`, a pipeline's graph, or an integration with its HTTP client mocked. Those calls do not need an engine.

To check that the module loads, build an engine and load it by name:

```python
from naas_abi_core.engine.Engine import Engine

def test_module_loads():
    engine = Engine()
    engine.load(module_names=["my_module"])
    assert "my_module" in engine.modules
```

In a NATS project, `Engine()` connects to a broker. Run one (`abi dev up` or `abi stack start`), or point `ABI_CONFIG_OVERLAY` at a YAML file that sets `nats: null`.

```bash
uv run pytest tests/test_my_module.py
```

The scaffold and the load hooks are on [Creating a Module](/user-guide/build/modules/creating-a-module#testing).
