File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 1- import pytest
1+ import os
22from pathlib import Path
3+ from typing import Optional
4+
5+ import pytest
36
47from bioimageio .spec .shared .raw_nodes import URI
58
69
10+ def mock_download (uri : URI , output : Optional [os .PathLike ] = None , pbar = None ):
11+ return Path (__file__ ).resolve ()
12+
13+
714@pytest .mark .parametrize (
815 "src" ,
916 [
10- "https://raw.githubusercontent. com/bioimage-io/spec-bioimage-io/main/example_specs/models/unet2d_nuclei_broad/rdf.yaml " ,
17+ "https://example. com/fake " ,
1118 Path (__file__ ),
1219 __file__ ,
13- URI (
14- "https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_specs/models/unet2d_nuclei_broad/rdf.yaml"
15- ),
20+ URI ("https://example.com/fake" ),
1621 ],
1722)
1823def test_get_resolved_source_path (src ):
1924 from bioimageio .spec .shared import get_resolved_source_path
2025
26+ import bioimageio .spec
27+
28+ bioimageio .spec .shared ._resolve_source ._download_url = mock_download
2129 res = get_resolved_source_path (src , root_path = Path (__file__ ).parent )
2230 assert isinstance (res , Path )
2331 assert res .exists ()
32+ assert res == Path (__file__ ).resolve ()
You can’t perform that action at this time.
0 commit comments