Skip to content

Commit

Permalink
Better test for truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Sep 8, 2023
1 parent fd53428 commit f42baa8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import pytest
import numpy as np

from corsikaio.constants import BLOCK_SIZE_BYTES
from corsikaio.io import RECORD_MARKER


def test_version():
from corsikaio import CorsikaFile
Expand Down Expand Up @@ -88,7 +91,15 @@ def test_particle_no_parse():



@pytest.mark.parametrize("size", (273 * 10, 5000, 273 * 2))
@pytest.mark.parametrize(
"size",
(
RECORD_MARKER.size + 22932,
RECORD_MARKER.size + 2 * 22932,
RECORD_MARKER.size + 3 * 22932,
2000,
)
)
def test_truncated(tmp_path, size):
'''Test we raise a meaningful error for a truncated file
Expand Down

0 comments on commit f42baa8

Please sign in to comment.