@@ -80,20 +80,27 @@ def test_str():
80
80
("http://example.com/this/is/../a//test" , "http://example.com/this/" , "a/test" ),
81
81
("http://example.com/path/to" , "http://example.com/spam/" , "../path/to" ),
82
82
("http://example.com/path" , "http://example.com/path/to/" , ".." ),
83
+ ("http://example.com/path" , "http://example.com/other/../path/to/" , ".." ),
83
84
("http://example.com/" , "http://example.com/" , "." ),
84
85
("http://example.com" , "http://example.com" , "." ),
85
86
("http://example.com/" , "http://example.com" , "." ),
86
87
("http://example.com" , "http://example.com/" , "." ),
87
88
("//example.com" , "//example.com" , "." ),
88
89
("/path/to" , "/spam/" , "../path/to" ),
89
90
("path/to" , "spam/" , "../path/to" ),
91
+ ("path/../to" , "path/" , "../to" ),
92
+ ("path/.." , "." , "path/.." ),
93
+ ("path/../replace/me" , "path/../replace" , "replace/me" ),
94
+ ("path/../replace/me" , "path/../replace/" , "me" ),
90
95
("path/to" , "spam" , "path/to" ),
91
96
(".." , "." , ".." ),
92
97
("." , ".." , "." ),
93
98
],
94
99
)
95
100
def test_sub (target : str , base : str , expected : str ):
96
- assert URL (target ) - URL (base ) == URL (expected )
101
+ expected_url = URL (expected )
102
+ result_url = URL (target ) - URL (base )
103
+ assert result_url == expected_url
97
104
98
105
99
106
def test_sub_with_different_schemes ():
0 commit comments