@@ -586,23 +586,22 @@ def test_got_updated_cookie_with_get(self):
586586 self .assertTrue (found )
587587
588588 def test_login_fails_with_bad_cookie (self ):
589- new_context = binding .connect (** {"cookie" : "bad=cookie" })
590589 # We should get an error if using a bad cookie
591590 try :
592- new_context . get ( "apps/local" )
591+ new_context = binding . connect ( ** { "cookie" : "bad=cookie" } )
593592 self .fail ()
594593 except AuthenticationError as ae :
595- self .assertEqual (str (ae ), "Request failed: Session is not logged in ." )
594+ self .assertEqual (str (ae ), "Login failed." )
596595
597596 def test_login_with_multiple_cookies (self ):
598- bad_cookie = 'bad=cookie'
599- new_context = binding .connect (** {"cookie" : bad_cookie })
600597 # We should get an error if using a bad cookie
598+ new_context = binding .Context ()
599+ new_context .get_cookies ().update ({"bad" : "cookie" })
601600 try :
602- new_context . get ( "apps/local" )
601+ new_context = new_context . login ( )
603602 self .fail ()
604603 except AuthenticationError as ae :
605- self .assertEqual (str (ae ), "Request failed: Session is not logged in ." )
604+ self .assertEqual (str (ae ), "Login failed." )
606605 # Bring in a valid cookie now
607606 for key , value in self .context .get_cookies ().items ():
608607 new_context .get_cookies ()[key ] = value
0 commit comments