ESC

Type to search...

Testing

Test Intents directly, mock processors, inspect pipelines.

Full reference: Testing Referencetc() helper, TestCase, pytest integration, native & @route styles.

Quick Start

# tests/test_api.py
from evoid.testing import tc
from myapp import GET_USER

def test_get_user():
    return tc(GET_USER, expect={"id": 1})
pytest tests/ -v

Testing Patterns

PatternCode
Direct executionawait execute(intent) — test pipelines without HTTP
Mockingunittest.mock.AsyncMock — replace processors for isolation
Pipeline inspectionConfig(inspect=True) — per-processor timing and state
Error testingtc(intent, expect_error=ValueError)

What You Learned

ConceptWhat It Is
Direct executionTest pipelines without HTTP
MockingReplace processors for isolation
Pipeline inspectionPer-processor timing and state
pytest integrationAsync test support

Next: Serialization

Let’s handle data serialization — Serialization.