Skip to content

Commit ac78e48

Browse files
committed
add test_get_resolved_source_path
1 parent e31881a commit ac78e48

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_shared/test_shared.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pytest
2+
from pathlib import Path
3+
4+
from bioimageio.spec.shared.raw_nodes import URI
5+
6+
7+
@pytest.mark.parametrize(
8+
"src",
9+
[
10+
"https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_specs/models/unet2d_nuclei_broad/rdf.yaml",
11+
Path(__file__),
12+
__file__,
13+
URI(
14+
"https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_specs/models/unet2d_nuclei_broad/rdf.yaml"
15+
),
16+
],
17+
)
18+
def test_get_resolved_source_path(src):
19+
from bioimageio.spec.shared import get_resolved_source_path
20+
21+
res = get_resolved_source_path(src, root_path=Path(__file__).parent)
22+
assert isinstance(res, Path)
23+
assert res.exists()

0 commit comments

Comments
 (0)