| 106 | |
| 107 | |
| 108 | def test_message_dump_file_single(tmp_path): |
| 109 | # Write the message to the stream |
| 110 | with open(tmp_path / "message_dump_file_single.out", "wb") as stream: |
| 111 | oneof_example.dump(stream) |
| 112 | |
| 113 | # Check that the outputted file is exactly as expected |
| 114 | with open(tmp_path / "message_dump_file_single.out", "rb") as test_stream, open( |
| 115 | streams_path / "message_dump_file_single.expected", "rb" |
| 116 | ) as exp_stream: |
| 117 | assert test_stream.read() == exp_stream.read() |
| 118 | |
| 119 | |
| 120 | def test_message_dump_file_multiple(tmp_path): |