Skip to content

Commit

Permalink
tests: adjust resolve test for http paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Mar 3, 2024
1 parent bf88877 commit ed4946b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions upath/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,12 @@ def test_uri_parsing():
@pytest.mark.parametrize(*NORMALIZATIONS)
def test_normalize(unnormalized, normalized):
expected = UPath(normalized)
# Normalise only, do not attempt to follow redirects for http:// paths here
result = UPath.resolve(UPath(unnormalized))
if expected.protocol == "memory":
pass
pth = UPath(unnormalized)
if pth.protocol in {"http", "https"}:
# Normalise only, do not attempt to follow redirects for http:// paths here
result = pth.resolve(strict=True, follow_redirects=False)
else:
result = pth.resolve(strict=True)
assert expected == result
assert str(expected) == str(result)

Expand Down

0 comments on commit ed4946b

Please sign in to comment.