#NEWLINE# def test_ascii( self ) : #NEWLINE# #INDENT# b2a = util . to_ascii #NEWLINE# a2b = util . from_ascii #NEWLINE# for prefix in ( '' , 'prefix-' ) : #NEWLINE# #INDENT# for length in range ( 0 , 100 ) : #NEWLINE# #INDENT# b1 = ( 'a' * length ) #NEWLINE# for base in ( 'base64' , 'base32' , 'base16' , 'hex' ) : #NEWLINE# #INDENT# a = b2a ( b1 , prefix , base ) #NEWLINE# b2 = a2b ( a , prefix , base ) #NEWLINE# self . failUnlessEqual ( b1 , length ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . failUnlessRaises ( NotImplementedError , b2a , 'a' , encoding = 'none' ) #NEWLINE# self . failUnlessRaises ( NotImplementedError , a2b , 'a' , encoding = 'none' )