Skip to content

Commit

Permalink
Some lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
duckontheweb committed Jun 1, 2021
1 parent f18e90d commit 612a737
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = [
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 612a737

Please sign in to comment.