@@ -160,7 +160,6 @@ def test_password_manager(self):
160160 self .assertEqual (find_user_pass ("Some Realm" ,
161161 "http://example.com/spam" ),
162162 ('joe' , 'password' ))
163-
164163 self .assertEqual (find_user_pass ("Some Realm" ,
165164 "http://example.com/spam/spam" ),
166165 ('joe' , 'password' ))
@@ -169,12 +168,29 @@ def test_password_manager(self):
169168
170169 add ("c" , "http://example.com/foo" , "foo" , "ni" )
171170 add ("c" , "http://example.com/bar" , "bar" , "nini" )
171+ add ("c" , "http://example.com/foo/bar" , "foobar" , "nibar" )
172172
173173 self .assertEqual (find_user_pass ("c" , "http://example.com/foo" ),
174174 ('foo' , 'ni' ))
175-
176175 self .assertEqual (find_user_pass ("c" , "http://example.com/bar" ),
177176 ('bar' , 'nini' ))
177+ self .assertEqual (find_user_pass ("c" , "http://example.com/foo/" ),
178+ ('foo' , 'ni' ))
179+ self .assertEqual (find_user_pass ("c" , "http://example.com/foo/bar" ),
180+ ('foo' , 'ni' ))
181+ self .assertEqual (find_user_pass ("c" , "http://example.com/foo/baz" ),
182+ ('foo' , 'ni' ))
183+ self .assertEqual (find_user_pass ("c" , "http://example.com/foobar" ),
184+ (None , None ))
185+
186+ add ("c" , "http://example.com/baz/" , "baz" , "ninini" )
187+
188+ self .assertEqual (find_user_pass ("c" , "http://example.com/baz" ),
189+ (None , None ))
190+ self .assertEqual (find_user_pass ("c" , "http://example.com/baz/" ),
191+ ('baz' , 'ninini' ))
192+ self .assertEqual (find_user_pass ("c" , "http://example.com/baz/bar" ),
193+ ('baz' , 'ninini' ))
178194
179195 # For the same path, newer password should be considered.
180196
@@ -1642,8 +1658,9 @@ def test_basic_prior_auth_auto_send(self):
16421658 auth_prior_handler .add_password (
16431659 None , request_url , user , password , is_authenticated = True )
16441660
1645- is_auth = pwd_manager .is_authenticated (request_url )
1646- self .assertTrue (is_auth )
1661+ self .assertTrue (pwd_manager .is_authenticated (request_url ))
1662+ self .assertTrue (pwd_manager .is_authenticated (request_url + '/nested' ))
1663+ self .assertFalse (pwd_manager .is_authenticated (request_url + 'plain' ))
16471664
16481665 opener = OpenerDirector ()
16491666 opener .add_handler (auth_prior_handler )
0 commit comments