def test_serialization_compression_verify(self): content = {"key": "message is a message", "text": "a dog ate a man"} message = Message(content=content) compressed = message.serialize(compress=True) message = Message(content=content) original = message.serialize() assert len(compressed) < len(original)
def test_serialization_compression_unicode(self): message = Message(content={"key": u"message \u6D88\u606F"}) result = Message.deserialize(message.serialize(compress=True)) self.assertDictEqual(message.content, result.content)