@@ -162,7 +162,6 @@ def test_password_manager(self):
162162 self .assertEqual (find_user_pass ("Some Realm" ,
163163 "http://example.com/spam" ),
164164 ('joe' , 'password' ))
165-
166165 self .assertEqual (find_user_pass ("Some Realm" ,
167166 "http://example.com/spam/spam" ),
168167 ('joe' , 'password' ))
@@ -171,12 +170,29 @@ def test_password_manager(self):
171170
172171 add ("c" , "http://example.com/foo" , "foo" , "ni" )
173172 add ("c" , "http://example.com/bar" , "bar" , "nini" )
173+ add ("c" , "http://example.com/foo/bar" , "foobar" , "nibar" )
174174
175175 self .assertEqual (find_user_pass ("c" , "http://example.com/foo" ),
176176 ('foo' , 'ni' ))
177-
178177 self .assertEqual (find_user_pass ("c" , "http://example.com/bar" ),
179178 ('bar' , 'nini' ))
179+ self .assertEqual (find_user_pass ("c" , "http://example.com/foo/" ),
180+ ('foo' , 'ni' ))
181+ self .assertEqual (find_user_pass ("c" , "http://example.com/foo/bar" ),
182+ ('foo' , 'ni' ))
183+ self .assertEqual (find_user_pass ("c" , "http://example.com/foo/baz" ),
184+ ('foo' , 'ni' ))
185+ self .assertEqual (find_user_pass ("c" , "http://example.com/foobar" ),
186+ (None , None ))
187+
188+ add ("c" , "http://example.com/baz/" , "baz" , "ninini" )
189+
190+ self .assertEqual (find_user_pass ("c" , "http://example.com/baz" ),
191+ (None , None ))
192+ self .assertEqual (find_user_pass ("c" , "http://example.com/baz/" ),
193+ ('baz' , 'ninini' ))
194+ self .assertEqual (find_user_pass ("c" , "http://example.com/baz/bar" ),
195+ ('baz' , 'ninini' ))
180196
181197 # For the same path, newer password should be considered.
182198
@@ -1656,8 +1672,9 @@ def test_basic_prior_auth_auto_send(self):
16561672 auth_prior_handler .add_password (
16571673 None , request_url , user , password , is_authenticated = True )
16581674
1659- is_auth = pwd_manager .is_authenticated (request_url )
1660- self .assertTrue (is_auth )
1675+ self .assertTrue (pwd_manager .is_authenticated (request_url ))
1676+ self .assertTrue (pwd_manager .is_authenticated (request_url + '/nested' ))
1677+ self .assertFalse (pwd_manager .is_authenticated (request_url + 'plain' ))
16611678
16621679 opener = OpenerDirector ()
16631680 opener .add_handler (auth_prior_handler )
0 commit comments