#NEWLINE# def test_bytesio( self ) : #NEWLINE# #INDENT# contents = six . BytesIO ( ( ( b'a' * 50 ) + ( b'b' * 50 ) ) ) #NEWLINE# contents . seek ( 22 ) #NEWLINE# data = u . LengthWrapper ( contents , 42 , True ) #NEWLINE# s = ( ( b'a' * 28 ) + ( b'b' * 14 ) ) #NEWLINE# read_data = b'' . join ( iter ( data . read , '' ) ) #NEWLINE# self . assertEqual ( 42 , len ( data ) ) #NEWLINE# self . assertEqual ( 42 , len ( read_data ) ) #NEWLINE# self . assertEqual ( s , read_data ) #NEWLINE# self . assertEqual ( md5 ( s ) . hexdigest ( ) , data . get_md5sum ( ) )