def test_env_log(self): packet_encoding.init_all() assert packet_encoding.get_packet_encoding_caps() assert packet_encoding.get_enabled_encoders() for x in packet_encoding.get_enabled_encoders(): e = packet_encoding.get_encoder(x) for packet_data in (["hello", { "foo": 1, "bar": True }], #b"foo", ): assert e v, flag = e(packet_data) assert v if x == "none": #'none' cannot decode back continue try: r = packet_encoding.decode(v, flag) assert r except Exception: print("error calling decode(%s, %s) for encoder %s" % (v, flag, x)) raise #one-shot function: assert packet_encoding.pack_one_packet(["hello", {}])
def enable_encoder(self, e): self._encoder = packet_encoding.get_encoder(e) self.encoder = e log("enable_encoder(%s): %s", e, self._encoder)
def enable_encoder(self, e): self._encoder = packet_encoding.get_encoder(e) self.encoder = e
def enable_encoder(self, e): self._encoder = packet_encoding.get_encoder(e) self.encoder = e log("enable_encoder(%s): %s", e, self._encoder)