Skip to content

Commit f42baa8

Browse files
committed
Better test for truncation
1 parent fd53428 commit f42baa8

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

tests/test_file.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import pytest
22
import numpy as np
33

4+
from corsikaio.constants import BLOCK_SIZE_BYTES
5+
from corsikaio.io import RECORD_MARKER
6+
47

58
def test_version():
69
from corsikaio import CorsikaFile
@@ -88,7 +91,15 @@ def test_particle_no_parse():
8891

8992

9093

91-
@pytest.mark.parametrize("size", (273 * 10, 5000, 273 * 2))
94+
@pytest.mark.parametrize(
95+
"size",
96+
(
97+
RECORD_MARKER.size + 22932,
98+
RECORD_MARKER.size + 2 * 22932,
99+
RECORD_MARKER.size + 3 * 22932,
100+
2000,
101+
)
102+
)
92103
def test_truncated(tmp_path, size):
93104
'''Test we raise a meaningful error for a truncated file
94105

0 commit comments

Comments
 (0)