Skip to content

Commit ef85383

Browse files
Added unit test to validate exceptions are being generated.
1 parent 3de91be commit ef85383

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/operations/test_cache.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def test_hash_int():
7171
assert result_hash == int_hash
7272

7373

74+
def test_hash_int_overflow():
75+
76+
emsarray.operations.cache.hash_int(hashlib.sha1(), 2 ** 31 - 5)
77+
78+
with pytest.raises(OverflowError):
79+
emsarray.operations.cache.hash_int(hashlib.sha1(), 2 ** 31)
80+
81+
7482
def test_cache_key_cfgrid1d(datasets: pathlib.Path):
7583
dataset_cf = emsarray.open_dataset(datasets / 'cfgrid1d.nc')
7684

0 commit comments

Comments
 (0)