MCPcopy Index your code
hub / github.com/danielgtaylor/python-betterproto / test_single_message

Function test_single_message

tests/test_streams.py:379–392  ·  view source on GitHub ↗
(compile_jar, tmp_path)

Source from the content-addressed store, hash-verified

377
378
379def test_single_message(compile_jar, tmp_path):
380 # Write message to file
381 with open(tmp_path / "py_single_message.out", "wb") as stream:
382 oneof_example.dump(stream)
383
384 # Have Java read and return the message
385 run_jar("single_message", tmp_path)
386
387 # Read and check the returned message
388 with open(tmp_path / "java_single_message.out", "rb") as stream:
389 returned = oneof.Test().load(stream, len(bytes(oneof_example)))
390 assert stream.read() == b""
391
392 assert returned == oneof_example
393
394
395def test_multiple_messages(compile_jar, tmp_path):

Callers

nothing calls this directly

Calls 3

run_jarFunction · 0.85
dumpMethod · 0.80
loadMethod · 0.80

Tested by

no test coverage detected