Files
ai-training/_docs/02_document/tests/test-data.md
T
Oleksandr Bezdieniezhnykh 142c6c4de8 Refactor constants management to use Pydantic BaseModel for configuration
- Replaced module-level path variables in constants.py with a structured Pydantic Config class.
- Updated all relevant modules (train.py, augmentation.py, exports.py, dataset-visualiser.py, manual_run.py) to access paths through the new config structure.
- Fixed bugs related to image processing and model saving.
- Enhanced test infrastructure to accommodate the new configuration approach.

This refactor improves code maintainability and clarity by centralizing configuration management.
2026-03-27 18:18:30 +02:00

1.6 KiB

Test Data Management

Fixture Sources

ID Data Item Source Format Preparation
FD-01 Annotated images (100) _docs/00_problem/input_data/dataset/images/ JPEG Copy subset to tmp_path at test start
FD-02 YOLO labels (100) _docs/00_problem/input_data/dataset/labels/ TXT Copy subset to tmp_path at test start
FD-03 ONNX model _docs/00_problem/input_data/azaion.onnx ONNX Read bytes at test start
FD-04 Class definitions classes.json (project root) JSON Copy to tmp_path at test start
FD-05 Corrupted labels Generated at test time TXT Create labels with coords > 1.0
FD-06 Edge-case bboxes Generated at test time In-memory Construct bboxes near image boundaries
FD-07 Detection objects Generated at test time In-memory Construct Detection instances for NMS tests
FD-08 Msgpack messages Generated at test time bytes Construct AnnotationMessage-compatible msgpack
FD-09 Random binary data Generated at test time bytes os.urandom(N) for encryption tests
FD-10 Empty label file Generated at test time TXT Empty file for augmentation edge case

Data Lifecycle

  1. Setup: pytest conftest.py copies fixture files to tmp_path
  2. Execution: Tests operate on copied data in isolation
  3. Teardown: tmp_path is automatically cleaned by pytest

Expected Results Location

All expected results are defined in _docs/00_problem/input_data/expected_results/results_report.md (37 test scenarios mapped).