Spaces:
Running
on
Zero
Running
on
Zero
| # Mosaic Unit Tests | |
| This directory contains comprehensive unit tests for the Mosaic package. | |
| ## Running Tests | |
| To run all tests: | |
| ```bash | |
| pytest tests/ | |
| ``` | |
| To run tests with coverage report: | |
| ```bash | |
| pytest tests/ --cov=src/mosaic --cov-report=term-missing | |
| ``` | |
| To run a specific test file: | |
| ```bash | |
| pytest tests/inference/test_data.py -v | |
| ``` | |
| ## Test Structure | |
| - `tests/inference/` - Tests for inference modules | |
| - `test_data.py` - Tests for data structures and datasets | |
| - `test_aeon.py` - Tests for Aeon inference module | |
| - `test_paladin.py` - Tests for Paladin inference module | |
| - `tests/test_gradio_app.py` - Tests for Gradio application utilities | |
| - `tests/conftest.py` - Pytest configuration and fixtures | |
| ## Test Coverage | |
| Current test coverage includes: | |
| ### Data Module (`mosaic.inference.data`) | |
| - β Cancer type mapping constants | |
| - β SiteType enum | |
| - β TileFeatureTensorDataset class | |
| - Dataset initialization | |
| - Feature padding and truncation | |
| - Data type conversions | |
| - Site type handling | |
| ### Aeon Module (`mosaic.inference.aeon`) | |
| - β Module constants | |
| - β Cancer type indices | |
| ### Paladin Module (`mosaic.inference.paladin`) | |
| - β Model map loading | |
| - β Aeon score loading | |
| - β Cancer subtype selection | |
| - β Logits to point estimates conversion | |
| - β UsageError exception | |
| ### Gradio App Module (`mosaic.gradio_app`) | |
| - β Constants (IHC subtypes, settings columns) | |
| - β Settings loading and validation | |
| - β Oncotree code name retrieval | |
| - β CSV export functionality | |
| ## Notes | |
| - Tests use mocking for external dependencies (e.g., mussel models, network requests) | |
| - Some tests require pytest-mock for mocking functionality | |
| - Tests are designed to run without requiring full model downloads or GPU access | |