Skip to content

Testing

Running Tests

# All tests
just test

# Python tests only
just pytest

# Type checking
just mypy

# Linting
just format

Test Structure

tests/
├── test_barista.py      # API client tests
├── test_cli.py          # CLI tests
└── test_simple.py       # Basic tests

Writing Tests

Use pytest style:

def test_create_model():
    client = BaristaClient()
    response = client.create_model(title="Test")
    assert response.ok
    assert response.model_id

Integration Tests

Set environment for integration tests:

# Set your dev token for integration tests
export BARISTA_TOKEN=your-dev-token-here
pytest tests/test_barista.py::test_integration

Coverage

pytest --cov=noctua tests/