@@ -0,0 +1,1440 @@
+#!/usr/bin/env python%0A%0Aimport unittest%0Aimport twisted.trial.unittest%0Afrom struct import pack%0A%0Afrom obfsproxy.network.buffer import Buffer%0Afrom obfsproxy.transports.bananaphone import rh_encoder, rh_decoder%0A%0Aclass test_Bananaphone(twisted.trial.unittest.TestCase):%0A%0A    @classmethod%0A    def setUpClass(cls):%0A        cls.encodingSpec = 'words,sha1,4'%0A        cls.modelName    = 'markov'%0A        cls.order        = 1%0A        cls.corpus       = '/usr/share/dict/words'%0A        cls.abridged     = None%0A%0A    def writeEncodeBuffer(self, buff):%0A        self.encodeBuffer.write(buff)%0A%0A    def writeDecodeBuffer(self, buff):%0A        self.decodeBuffer.write(buff)%0A%0A    def test_1(self):%0A        self.encodeBuffer = Buffer()%0A        self.decodeBuffer = Buffer()%0A%0A        if self.modelName == 'markov':%0A            args = %5B self.corpus, self.order, self.abridged %5D%0A        elif self.modelName == 'random':%0A            args = %5B self.corpus %5D%0A%0A        self.encoder = rh_encoder(self.encodingSpec, self.modelName, *args) %3E self.writeEncodeBuffer%0A        self.decoder = rh_decoder(self.encodingSpec) %3E self.writeDecodeBuffer%0A%0A        orig_message = 'War is peace. Freedom is slavery.  Ignorance is strength.'%0A        self.encoder.send(orig_message)%0A        encoded_message = self.encodeBuffer.read()%0A        self.decoder.send(encoded_message)%0A        self.assertEqual(orig_message, self.decodeBuffer.read())%0A%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

Add simple unit test for Bananaphone codec