Skip to content

Commit

Permalink
Add test coverage for creating URLs from pre-encodeded str (#1370)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 21, 2024
1 parent ea970f2 commit 7175383
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,19 @@ def test_split_result_encoded():
assert str(url) == "http://example.com/path?qs#frag"


def test_str_encoded():
url = URL("http://example.com/path?qs#frag%2F%2D", encoded=True)
assert str(url) == "http://example.com/path?qs#frag%2F%2D"


def test_subclassed_str_encoded():
class S(str):
"""Subclass of str."""

url = URL(S("http://example.com/path?qs#frag%2F%2D"), encoded=True)
assert str(url) == "http://example.com/path?qs#frag%2F%2D"


def test_human_repr():
url = URL("http://бажан:пароль@хост.домен:8080/шлях/сюди?арг=вал#фраг")
s = url.human_repr()
Expand Down

0 comments on commit 7175383

Please sign in to comment.