<s> from __future__ import with_statement <EOL> from smugpy import SmugMug , SmugMugException <EOL> from . import smugpy <EOL> import sys <EOL> import unittest <EOL> API_KEY = "<STR_LIT>" <EOL> class TestLogin ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . smugmug = SmugMug ( api_key = API_KEY , api_version = '<STR_LIT>' , app_name = '<STR_LIT>' ) <EOL> def test_login_anonymously ( self ) : <EOL> self . smugmug . login_anonymously ( ) <EOL> self . assertNotEqual ( self . smugmug . session_id , None ) <EOL> self . smugmug . reset_auth ( ) <EOL> def test_login_withHash ( self ) : <EOL> self . smugmug . login_withHash ( UserID = '<STR_LIT:test>' , PasswordHash = '<STR_LIT>' ) <EOL> self . assertNotEqual ( self . smugmug . session_id , None ) <EOL> self . smugmug . reset_auth ( ) <EOL> def test_login_withPassword ( self ) : <EOL> self . smugmug . login_withPassword ( EmailAddress = '<STR_LIT>' , Password = '<STR_LIT>' ) <EOL> self . assertNotEqual ( self . smugmug . session_id , None ) <EOL> self . smugmug . reset_auth ( ) <EOL> class TestLogin130 ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . smugmug = SmugMug ( api_key = API_KEY , api_version = '<STR_LIT>' , app_name = '<STR_LIT>' ) <EOL> def test_login_anonymously ( self ) : <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> ) : <EOL> self . assertRaises ( SmugMugException , lambda : self . smugmug . login_anonymously ( ) ) <EOL> else : <EOL> with self . assertRaises ( SmugMugException ) : <EOL> self . smugmug . login_anonymously ( ) <EOL> def test_login_withHash ( self ) : <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> ) : <EOL> self . assertRaises ( SmugMugException , lambda : self . smugmug . login_withHash ( UserID = '<STR_LIT:test>' , PasswordHash = '<STR_LIT>' ) ) <EOL> else : <EOL> with self . assertRaises ( SmugMugException ) : <EOL> self . smugmug . login_withHash ( UserID = '<STR_LIT:test>' , PasswordHash = '<STR_LIT>' ) <EOL> def test_login_withPassword ( self ) : <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> ) : <EOL> self . assertRaises ( SmugMugException , lambda : self . smugmug . login_withPassword ( EmailAddress = '<STR_LIT>' , Password = '<STR_LIT>' ) ) <EOL> else : <EOL> with self . assertRaises ( SmugMugException ) : <EOL> self . smugmug . login_withPassword ( EmailAddress = '<STR_LIT>' , Password = '<STR_LIT>' ) </s>
