Skip to content

Commit

Permalink
Fix type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Jan 25, 2024
1 parent c3a596a commit 990ea36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/warc2zim/url_rewriting.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def reduce(path: str) -> str:
return path


def normalize(url: str | bytes) -> str:
def normalize(url: str | bytes | None) -> str:
"""Normalize a properly contructed url to a path to use as a entry's key.
>>> normalize("http://exemple.com/path/to/article?foo=bar")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_warc_to_zim.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def verify_warc_and_zim(self, warcfile, zimfile):
warc_urls.add(url)

def test_normalize(self):
assert normalize(None) is None # pyright: ignore
assert normalize(None) is None
assert normalize("") == ""
assert normalize("https://exemple.com") == "exemple.com"
assert normalize("https://exemple.com/") == "exemple.com/"
Expand Down

0 comments on commit 990ea36

Please sign in to comment.