def _process(self, sequence, producer): for operands in sequence: for name, value in operands: if value: product = json.decode(value) yield product.items() if hasattr(product, "items") \ else (("array", product), )
def test_encode_decode(self): obj = {"timetag": datetime.datetime.now(), "data": b"unittest"} encoded = json.encode(obj) decoded = json.decode(encoded) self.assertEqual(obj, decoded)