@@ -19,7 +19,7 @@ def test_uri_parse_http_with_port():
1919 testing.assert_equal(uri.port.value(), 8080 )
2020 testing.assert_equal(uri.path, " /index.html" )
2121 testing.assert_equal(uri._original_path, " /index.html" )
22- # testing.assert_equal(uri.request_uri, "http://example.com:8080 /index.html")
22+ testing.assert_equal(uri.request_uri, " /index.html" )
2323 testing.assert_equal(uri.is_https(), False )
2424 testing.assert_equal(uri.is_http(), True )
2525 testing.assert_equal(uri.query_string, empty_string)
@@ -32,7 +32,7 @@ def test_uri_parse_https_with_port():
3232 testing.assert_equal(uri.port.value(), 8080 )
3333 testing.assert_equal(uri.path, " /index.html" )
3434 testing.assert_equal(uri._original_path, " /index.html" )
35- # testing.assert_equal(uri.request_uri, "https://example.com:8080 /index.html")
35+ testing.assert_equal(uri.request_uri, " /index.html" )
3636 testing.assert_equal(uri.is_https(), True )
3737 testing.assert_equal(uri.is_http(), False )
3838 testing.assert_equal(uri.query_string, empty_string)
@@ -44,7 +44,7 @@ def test_uri_parse_http_with_path():
4444 testing.assert_equal(uri.host, " example.com" )
4545 testing.assert_equal(uri.path, " /index.html" )
4646 testing.assert_equal(uri._original_path, " /index.html" )
47- # testing.assert_equal(uri.request_uri, "http://example.com /index.html")
47+ testing.assert_equal(uri.request_uri, " /index.html" )
4848 testing.assert_equal(uri.is_https(), False )
4949 testing.assert_equal(uri.is_http(), True )
5050 testing.assert_equal(uri.query_string, empty_string)
@@ -56,7 +56,7 @@ def test_uri_parse_https_with_path():
5656 testing.assert_equal(uri.host, " example.com" )
5757 testing.assert_equal(uri.path, " /index.html" )
5858 testing.assert_equal(uri._original_path, " /index.html" )
59- # testing.assert_equal(uri.request_uri, "https://example.com /index.html")
59+ testing.assert_equal(uri.request_uri, " /index.html" )
6060 testing.assert_equal(uri.is_https(), True )
6161 testing.assert_equal(uri.is_http(), False )
6262 testing.assert_equal(uri.query_string, empty_string)
@@ -68,7 +68,7 @@ def test_uri_parse_http_basic():
6868 testing.assert_equal(uri.host, " example.com" )
6969 testing.assert_equal(uri.path, " /" )
7070 testing.assert_equal(uri._original_path, " /" )
71- # testing.assert_equal(uri.request_uri, "/")
71+ testing.assert_equal(uri.request_uri, " /" )
7272 testing.assert_equal(uri.query_string, empty_string)
7373
7474
@@ -78,7 +78,7 @@ def test_uri_parse_http_basic_www():
7878 testing.assert_equal(uri.host, " www.example.com" )
7979 testing.assert_equal(uri.path, " /" )
8080 testing.assert_equal(uri._original_path, " /" )
81- # testing.assert_equal(uri.request_uri, "/")
81+ testing.assert_equal(uri.request_uri, " /" )
8282 testing.assert_equal(uri.query_string, empty_string)
8383
8484
@@ -88,7 +88,7 @@ def test_uri_parse_http_with_query_string():
8888 testing.assert_equal(uri.host, " www.example.com" )
8989 testing.assert_equal(uri.path, " /job" )
9090 testing.assert_equal(uri._original_path, " /job" )
91- # testing.assert_equal(uri.request_uri, "/job?title=engineer")
91+ testing.assert_equal(uri.request_uri, " /job?title=engineer" )
9292 testing.assert_equal(uri.query_string, " title=engineer" )
9393
9494
@@ -98,5 +98,20 @@ def test_uri_parse_no_scheme():
9898 testing.assert_equal(uri.host, " www.example.com" )
9999
100100
101+ def test_uri_ip_address_no_scheme ():
102+ var uri = URI .parse(" 168.22.0.1/path/to/favicon.ico" )
103+ testing.assert_equal(uri.scheme, " http" )
104+ testing.assert_equal(uri.host, " 168.22.0.1" )
105+ testing.assert_equal(uri.path, " /path/to/favicon.ico" )
106+
107+
108+ def test_uri_ip_address ():
109+ var uri = URI .parse(" http://168.22.0.1:8080/path/to/favicon.ico" )
110+ testing.assert_equal(uri.scheme, " http" )
111+ testing.assert_equal(uri.host, " 168.22.0.1" )
112+ testing.assert_equal(uri.path, " /path/to/favicon.ico" )
113+ testing.assert_equal(uri.port.value(), 8080 )
114+
115+
101116# def test_uri_parse_http_with_hash():
102117# ...
0 commit comments