Add unit tests for bioxel module and documentation
- Created README.md for test instructions and categories. - Implemented comprehensive unit tests for the Data, Layer, and utility functions in the bioxel module. - Added tests for reading NRRD and DICOM formats, data properties, and edge cases. - Included tests for real data files to ensure functionality with actual datasets.
This commit is contained in:
43
tests/README.md
Normal file
43
tests/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# BioxelNodes Unit Tests
|
||||
|
||||
This directory contains unit tests for the bioxel module.
|
||||
|
||||
## Test Data
|
||||
|
||||
Test files should be placed in `tests/data/`:
|
||||
|
||||
## Running Tests
|
||||
|
||||
Run all tests:
|
||||
```bash
|
||||
uv run pytest
|
||||
```
|
||||
|
||||
Run specific test file:
|
||||
```bash
|
||||
uv run pytest tests/test_bioxel.py
|
||||
```
|
||||
|
||||
Run specific test class:
|
||||
```bash
|
||||
uv run pytest tests/test_bioxel.py::TestDataClass
|
||||
```
|
||||
|
||||
Run with verbose output:
|
||||
```bash
|
||||
uv run pytest -v
|
||||
```
|
||||
|
||||
Run with coverage:
|
||||
```bash
|
||||
uv run pytest --cov=bioxelnodes.bioxel --cov-report=html
|
||||
```
|
||||
|
||||
## Test Categories
|
||||
|
||||
- **TestDataClass**: Data class initialization and properties
|
||||
- **TestDataToLayers**: Data.to_layers() method
|
||||
- **TestUtilityFunctions**: Utility functions
|
||||
- **TestLayerClass**: Layer class functionality
|
||||
- **TestConstants**: Module constants
|
||||
- **TestEdgeCases**: Edge cases and error handling
|
||||
Reference in New Issue
Block a user