diff --git a/pyproject.toml b/pyproject.toml index 798c8f2..484ecf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,18 @@ allenmouse = [ "allensdk", ] +dev = [ + "pytest", + "pytest-cov", + "coverage", + "tox", + "black", + "mypy", + "pre-commit", + "ruff", + "setuptools_scm", +] + [build-system] requires = [ "setuptools>=45", @@ -59,12 +71,6 @@ include-package-data = true [tool.setuptools.packages.find] include = ["bg_atlasgen*"] -[tool.pytest.ini_options] -addopts = "--cov=bg_atlasgen" -filterwarnings = [ - "error", -] - [tool.black] target-version = ['py38', 'py39', 'py310', 'py311'] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_unit/test_validation.py b/tests/test_unit/test_validation.py new file mode 100644 index 0000000..5c7433c --- /dev/null +++ b/tests/test_unit/test_validation.py @@ -0,0 +1,15 @@ +import pytest +from pathlib import Path +from bg_atlasgen.validate_atlases import validate_atlas_files +from bg_atlasapi import BrainGlobeAtlas +from bg_atlasapi.config import get_brainglobe_dir + +def test_valid_atlas_files(): + _ = BrainGlobeAtlas("allen_mouse_100um") + atlas_path = Path(get_brainglobe_dir()) / "allen_mouse_100um_v1.2" + assert validate_atlas_files(atlas_path) + +def test_invalid_atlas_path(): + atlas_path = Path.home() + with pytest.raises(AssertionError, match="Expected file not found"): + validate_atlas_files(atlas_path) \ No newline at end of file