Skip to content

Commit

Permalink
Test writing multiple chunked files
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob720 committed Jan 7, 2025
1 parent dd637d9 commit abe2d06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_pb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,20 @@ def test_chunking_read_write_all_types():
for pv_type in pv_types:
read_file = Path(f"tests/test_data/{pv_type}_test_data.pb")
write_file = Path(f"tests/test_data/write_chunked_{pv_type}_test_data.pb")
write_file2 = Path(f"tests/test_data/write_chunked_{pv_type}_test_data2.pb")
pb = PBUtils(read_file, chunk_size=13)
pb.write_pb(write_file)
pb.write_pb(write_file2)
assert pb.read_done is False
while pb.read_done is False:
pb.read_pb(read_file)
pb.write_pb(write_file)
pb.write_pb(write_file2)
are_identical = filecmp.cmp(read_file, write_file, shallow=False)
are_identical2 = filecmp.cmp(read_file, write_file2, shallow=False)
if are_identical is True:
write_file.unlink() # Delete results file if test passes
assert are_identical is True
if are_identical2 is True:
write_file2.unlink() # Delete results file if test passes
assert are_identical2 is True

0 comments on commit abe2d06

Please sign in to comment.