| 1013 | |
| 1014 | @pytest.mark.parametrize("seed_value", SEED_VALUES) |
| 1015 | def test_hasher_incremental_vs_one_shot(seed_value: int): |
| 1016 | data_full = b"hello world" |
| 1017 | data_prefix = b"hello " |
| 1018 | data_suffix = b"world" |
| 1019 | |
| 1020 | hasher = sz.Hasher(seed=seed_value) |
| 1021 | hasher.update(data_prefix) |
| 1022 | hasher.update(data_suffix) |
| 1023 | streamed_hash = hasher.digest() |
| 1024 | |
| 1025 | expected_hash = sz.hash(data_full, seed=seed_value) |
| 1026 | assert isinstance(streamed_hash, int) |
| 1027 | assert streamed_hash == expected_hash |
| 1028 | |
| 1029 | |
| 1030 | @pytest.mark.parametrize("seed_value", SEED_VALUES) |