@@ -33,6 +33,11 @@ def test_make_relative_href(self) -> None:
3333 ("/a/catalog.json" , "/a/b/c/catalog.json" , "../../catalog.json" ),
3434 ("/a/b/c/d/" , "/a/b/c/catalog.json" , "./d/" ),
3535 ("/a/b/c/d/.dotfile" , "/a/b/c/d/catalog.json" , "./.dotfile" ),
36+ (
37+ "file:///a/b/c/d/catalog.json" ,
38+ "file:///a/b/c/catalog.json" ,
39+ "./d/catalog.json" ,
40+ ),
3641 ]
3742
3843 for source_href , start_href , expected in test_cases :
@@ -161,6 +166,13 @@ def test_make_absolute_href(self) -> None:
161166 "https://stacspec.org/a/b/item.json" ,
162167 ),
163168 ("http://localhost:8000" , None , "http://localhost:8000" ),
169+ ("item.json" , "file:///a/b/c/catalog.json" , "file:///a/b/c/item.json" ),
170+ (
171+ "./z/item.json" ,
172+ "file:///a/b/c/catalog.json" ,
173+ "file:///a/b/c/z/item.json" ,
174+ ),
175+ ("file:///a/b/c/item.json" , None , "file:///a/b/c/item.json" ),
164176 ]
165177
166178 for source_href , start_href , expected in test_cases :
@@ -219,6 +231,8 @@ def test_is_absolute_href(self) -> None:
219231 ("item.json" , False ),
220232 ("./item.json" , False ),
221233 ("../item.json" , False ),
234+ ("/home/someuser/item.json" , True ),
235+ ("file:///home/someuser/item.json" , True ),
222236 ("http://stacspec.org/item.json" , True ),
223237 ]
224238
0 commit comments