# Test Data Management

## Fixture Sources

| ID | Data Item | Source | Format | Preparation |
|----|-----------|--------|--------|-------------|
| FD-01 | Annotated images (20) | `tests/data/images/` | JPEG | Copy subset to tmp_path at test start |
| FD-02 | YOLO labels (20) | `tests/data/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).
