#NEWLINE# def test_encode_binary_b64_packet( self ) : #NEWLINE# #INDENT# pkt = packet . Packet ( packet . MESSAGE , data = b'\x01\x02\x03\x04' , binary = True ) #NEWLINE# self . assertEqual ( pkt . packet_type , packet . MESSAGE ) #NEWLINE# self . assertEqual ( pkt . data , b'\x01\x02\x03\x04' ) #NEWLINE# self . assertTrue ( pkt . binary ) #NEWLINE# self . assertEqual ( pkt . encode ( b64 = True ) , b'b4AQIDBA==' )