15 lines
386 B
Python
15 lines
386 B
Python
import hashlib
|
|
import unittest
|
|
|
|
import hashtool.hash
|
|
|
|
|
|
class TestFilehashes(unittest.TestCase):
|
|
def test_sha256(self):
|
|
hexdigests = hashtool.hash.filehashes("data/image001.jpg", {"SHA256": hashlib.sha256()})
|
|
self.assertEqual(hexdigests, {"SHA256": "75669a50892ea4e8e4ba2565915a7d48af9d98393ea463fd9cd71a6d16f258d2"})
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|