From 77fa67aaf2dc18962fa9234d47400c8a6fc1edf4 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 22 Nov 2022 17:06:51 +0100 Subject: Strip leading zeros from ports --- test/test_util.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/test_util.py b/test/test_util.py index e64c0cfc..78243552 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -348,6 +348,10 @@ class TestUtil: with pytest.raises(LocationParseError): parse_url("https://www.google.com:-80/") + def test_parse_url_remove_leading_zeros(self) -> None: + url = parse_url("https://example.com:0000000000080") + assert url.port == 80 + def test_Url_str(self) -> None: U = Url("http", host="google.com") assert str(U) == U.url -- cgit v1.2.1