#NEWLINE# def test_unicode( self ) : #NEWLINE# #INDENT# unicode_data = 'abc' #NEWLINE# actual_md5sum = md5 ( unicode_data . encode ( ) ) . hexdigest ( ) #NEWLINE# chunk_size = 2 #NEWLINE# with tempfile . TemporaryFile ( mode = 'w+' ) as f : #NEWLINE# #INDENT# f . write ( x ) #NEWLINE# f . seek ( 0 ) #NEWLINE# data = u . ReadableToIterable ( f , chunk_size , True ) #NEWLINE# x = next ( data ) #NEWLINE# self . assertEqual ( 2 , len ( x ) ) #NEWLINE# self . assertEqual ( unicode_data [ : 2 ] , x ) #NEWLINE# x = next ( data ) #NEWLINE# self . assertEqual ( 1 , len ( x ) ) #NEWLINE# self . assertEqual ( unicode_data [ 2 : ] , x ) #NEWLINE# self . assertEqual ( actual_md5sum , data . get_md5sum ( ) )