async def _async() -> None: data = Person() data.name = 'John Doe' data.id = '12' json_message = await instance.message_protocol.build_message( instance, 'topic', data) await instance.message_protocol.parse_message(json_message, str)
async def _async() -> None: data = Person() data.name = "John Doe" data.id = "12" json_message = await instance.message_envelope.build_message( instance, "topic", data) await instance.message_envelope.parse_message(json_message, str)
async def _async() -> None: data = Person() data.name = 'John Doe' data.id = '12' protobuf_message = await instance.message_protocol.build_message( instance, 'topic', data) await instance.message_protocol.parse_message(protobuf_message, Person, test_validator)
async def _async() -> None: data = Person() data.name = "John Doe" data.id = "12" protobuf_message = await instance.message_envelope.build_message( instance, "topic", data) await instance.message_envelope.parse_message(protobuf_message, Person, test_validator)
async def _async() -> None: data = Person() data.name = 'John Doe' data.id = '12' protobuf_message = await instance.message_protocol.build_message( instance, 'topic', data) result, message_uuid, timestamp = await instance.message_protocol.parse_message( protobuf_message) assert type(result.get('data')) is not Person assert type(result.get('data')) is bytes assert result.get('data') != data assert result.get('data') == b'\n\x0212"\x08John Doe'
async def _async() -> None: data = Person() data.name = "John Doe" data.id = "12" protobuf_message = await instance.message_envelope.build_message( instance, "topic", data) result, message_uuid, timestamp = await instance.message_envelope.parse_message( protobuf_message) assert type(result.get("data")) is not Person assert type(result.get("data")) is bytes assert result.get("data") != data assert result.get("data") == b"\n\x0212\x12\x08John Doe"
async def _async() -> None: data = Person() data.name = 'John Doe' data.id = '12' t1 = time.time() protobuf_message = await instance.message_protocol.build_message( instance, 'topic', data) t2 = time.time() result, message_uuid, timestamp = await instance.message_protocol.parse_message( protobuf_message, Person) assert type(result.get('data')) is Person assert result.get('data') == data assert result.get('metadata', {}).get('data_encoding') == 'proto' assert result.get('data') == data assert result.get('data').name == data.name assert result.get('data').id == data.id assert len(MessageToJson(result.get('data'))) == len( MessageToJson(data)) assert MessageToJson(result.get('data')) == MessageToJson(data) assert len(message_uuid) == 73 assert message_uuid[0:36] == instance.uuid assert timestamp >= t1 assert timestamp <= t2
async def _async() -> None: data = Person() data.name = "John Doe" data.id = "12" t1 = time.time() protobuf_message = await instance.message_envelope.build_message( instance, "topic", data) t2 = time.time() result, message_uuid, timestamp = await instance.message_envelope.parse_message( protobuf_message, Person) assert type(result.get("data")) is Person assert result.get("data") == data assert result.get("metadata", {}).get("data_encoding") == "proto" assert result.get("data") == data assert result.get("data").name == data.name assert result.get("data").id == data.id assert len(MessageToJson(result.get("data"))) == len( MessageToJson(data)) assert MessageToJson(result.get("data")) == MessageToJson(data) assert len(message_uuid) == 73 assert message_uuid[0:36] == instance.uuid assert timestamp >= t1 assert timestamp <= t2