Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.25 KB

File metadata and controls

39 lines (27 loc) · 1.25 KB

Unit Tests

This guide covers the structure, tooling, and conventions for the unit test suite in mpt-api-python-client.

Directory Layout

tests/
└── unit/
    ├── conftest.py      # Shared fixtures (http_client, async_http_client, DummyModel)
    ├── http/            # Transport, services, and mixins
    ├── models/          # Model, Collection, and Meta behavior
    ├── resources/       # Resource-domain services (accounts, catalog, …)
    ├── rql/             # RQL query builder
    ├── test_constants.py
    ├── test_exceptions.py
    └── test_mpt_client.py

Running Tests

All commands run inside the Docker-based Makefile drivers.

make test                          # run the full unit suite
make test args="tests/unit/http"   # run a specific directory
make test args="-k test_create"    # run a specific test pattern

Unit tests general rules

Python Unit test general rules with examples

Unit tests mocking

Unit tests mocks wiht examples