def authenticateConnection(self): if self.initial: return authMsg=AuthenticationMessage() encoded=authMsg.encodeMessage() self.sendPackage(encoded) response=self.connection.recv(1024) if response is not None: self.initial=True
def testAuthentication(self): msg=AuthenticationMessage() newmsg=msg.encodeMessage() msg2=AuthenticationMessage.decodeMessage(newmsg) self.assertEqual(msg.FRAME_SIZE,msg2.FRAME_SIZE)