Same file gives same hash on repeated calls.
(tmp_file)
| 41 | |
| 42 | |
| 43 | def test_file_hash_consistent(tmp_file): |
| 44 | """Same file gives same hash on repeated calls.""" |
| 45 | h1 = file_hash(tmp_file) |
| 46 | h2 = file_hash(tmp_file) |
| 47 | assert h1 == h2 |
| 48 | assert isinstance(h1, str) |
| 49 | assert len(h1) == 64 # SHA256 hex digest length |
| 50 | |
| 51 | |
| 52 | def test_file_hash_changes(tmp_path): |
nothing calls this directly
no test coverage detected