def testEncodeAndDecode(self): data = numpy.zeros(1000, dtype=numpy.uint32) encData = haarstego.encode(data, self.msg) decMsgList = haarstego.decode(encData) decMsg = haarstego.listToText(decMsgList) self.assertEqual(decMsg, "[{0}]".format(self.msg))
def testEncodeAndDecodeOnRandom(self): data = numpy.random.randint(0, high=256, size=1000).astype(numpy.uint32) encData = haarstego.encode(data, self.msg) decMsgList = haarstego.decode(encData) decMsg = haarstego.listToText(decMsgList) self.assertEqual(decMsg, "[{0}]".format(self.msg))