diff --git a/tests/test_utils.py b/tests/test_utils.py index e1f1a47e0..37e197c2d 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -11,14 +11,24 @@ class UtilsTest(unittest.TestCase): - - @unittest.skipIf(sys.platform in ("win32", "cygwin")) - def test_make_relative_href(self): + @unittest.skipIf( + sys.platform in ("win32", "cygwin"), reason="Paths are specific to posix" + ) + def test_make_relative_href(self) -> None: # Test cases of (source_href, start_href, expected) test_cases = [ ("/a/b/c/d/catalog.json", "/a/b/c/catalog.json", "./d/catalog.json"), ("/a/b/catalog.json", "/a/b/c/catalog.json", "../catalog.json"), ("/a/catalog.json", "/a/b/c/catalog.json", "../../catalog.json"), + ] + + for source_href, start_href, expected in test_cases: + actual = make_relative_href(source_href, start_href) + self.assertEqual(actual, expected) + + def test_make_relative_href_url(self) -> None: + + test_cases = [ ( "http://stacspec.org/a/b/c/d/catalog.json", "http://stacspec.org/a/b/c/catalog.json", @@ -105,7 +115,9 @@ def test_make_relative_href_windows(self): finally: utils._pathlib = os.path - @unittest.skipIf(sys.platform in ("win32", "cygwin")) + @unittest.skipIf( + sys.platform in ("win32", "cygwin"), reason="Paths are specific to posix" + ) def test_make_absolute_href(self): # Test cases of (source_href, start_href, expected) test_cases = [ @@ -139,7 +151,9 @@ def test_make_absolute_href(self): actual = make_absolute_href(source_href, start_href) self.assertEqual(actual, expected) - @unittest.skipIf(sys.platform in ("win32", "cygwin")) + @unittest.skipIf( + sys.platform in ("win32", "cygwin"), reason="Paths are specific to posix" + ) def test_make_absolute_href_on_vsitar(self): rel_path = "some/item.json" cat_path = "/vsitar//tmp/catalog.tar/catalog.json"