move importer test fixture into separate repo
2
.github/workflows/tests.yml
vendored
@@ -10,6 +10,8 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
|
||||
3
.gitignore
vendored
@@ -14,4 +14,5 @@ frontend/dist/
|
||||
.venv/
|
||||
sessions/
|
||||
frontend/coverage/
|
||||
usage_stats.json
|
||||
usage_stats.json
|
||||
tests/output/*.png
|
||||
@@ -2,11 +2,20 @@ from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from backend.data_types import DataField
|
||||
from backend.execution import ExecutionEngine
|
||||
import backend.nodes # noqa: F401
|
||||
|
||||
FIXTURES = Path(__file__).parent.parent / "output"
|
||||
FIXTURES = Path(__file__).parent.parent / "fixtures"
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
not (FIXTURES / "Bacteria.ibw").exists() or not (FIXTURES / "nanoparticles.npy").exists(),
|
||||
reason=(
|
||||
"tono-test-data fixtures not available — "
|
||||
"run `git submodule update --init tests/fixtures`"
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def test_load_npy():
|
||||
|
||||
@@ -11,7 +11,10 @@ import pytest
|
||||
|
||||
from backend.data_types import DataField
|
||||
|
||||
FIXTURES = Path(__file__).parent.parent / "output"
|
||||
FIXTURES = Path(__file__).parent.parent / "fixtures"
|
||||
_SUBMODULE_HINT = (
|
||||
"run `git submodule update --init tests/fixtures` to fetch the tono-test-data submodule"
|
||||
)
|
||||
|
||||
|
||||
# ── Registry ─────────────────────────────────────────────────────────────────
|
||||
@@ -122,7 +125,7 @@ class TestArrayImageImporter:
|
||||
def test_fixture_npy(self):
|
||||
path = FIXTURES / "nanoparticles.npy"
|
||||
if not path.exists():
|
||||
pytest.skip("fixture not available")
|
||||
pytest.skip(f"nanoparticles.npy fixture not available — {_SUBMODULE_HINT}")
|
||||
fields = self.mod.load(path)
|
||||
assert len(fields) == 1
|
||||
assert fields[0].data.ndim == 2
|
||||
@@ -144,7 +147,7 @@ class TestIBWImporter:
|
||||
|
||||
def test_load_fixture(self):
|
||||
if not self.fixture.exists():
|
||||
pytest.skip("Bacteria.ibw fixture not available")
|
||||
pytest.skip(f"Bacteria.ibw fixture not available — {_SUBMODULE_HINT}")
|
||||
fields = self.mod.load(self.fixture)
|
||||
assert len(fields) == 4
|
||||
for f in fields:
|
||||
@@ -156,7 +159,7 @@ class TestIBWImporter:
|
||||
|
||||
def test_channel_names_fixture(self):
|
||||
if not self.fixture.exists():
|
||||
pytest.skip("Bacteria.ibw fixture not available")
|
||||
pytest.skip(f"Bacteria.ibw fixture not available — {_SUBMODULE_HINT}")
|
||||
names = self.mod.channel_names(self.fixture)
|
||||
assert len(names) == 4
|
||||
assert all(isinstance(n, str) for n in names)
|
||||
|
||||
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 981 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |