#NEWLINE# def test_get_cached_auth_token_corrupted_token_cache_file( self ) : #NEWLINE# #INDENT# client = Client ( ) #NEWLINE# shell = Shell ( ) #NEWLINE# username = 'testu' #NEWLINE# password = 'testp' #NEWLINE# cached_token_path = shell . _get_cached_token_path_for_user ( username = username ) #NEWLINE# with open ( cached_token_path , 'w' ) as fp : #NEWLINE# #INDENT# fp . write ( 'CORRRRRUPTED!' ) #NEWLINE# #UNINDENT# expected_msg = 'File (.+) with cached token is corrupted or invalid' #NEWLINE# self . assertRaisesRegexp ( ValueError , expected_msg , shell . _get_cached_auth_token , client = client , username = username , password = password )