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

Function run_java_single_varint

tests/test_streams.py:322–336  ·  view source on GitHub ↗
(value: int, tmp_path)

Source from the content-addressed store, hash-verified

320
321
322def run_java_single_varint(value: int, tmp_path) -> int:
323 # Write single varint to file
324 with open(tmp_path / "py_single_varint.out", "wb") as stream:
325 betterproto.dump_varint(value, stream)
326
327 # Have Java read this varint and write it back
328 run_jar("single_varint", tmp_path)
329
330 # Read single varint from Java output file
331 with open(tmp_path / "java_single_varint.out", "rb") as stream:
332 returned = betterproto.load_varint(stream)
333 with pytest.raises(EOFError):
334 betterproto.load_varint(stream)
335
336 return returned
337
338
339def test_single_varint(compile_jar, tmp_path):

Callers 1

test_single_varintFunction · 0.85

Calls 1

run_jarFunction · 0.85

Tested by

no test coverage detected