def testFileHashMatchesKnownFile(self): """Tests that hasher matches the hash of a known file.""" expected_md5 = u'd73c51f10c7ee6a681b7b619ccc6f1c4' hasher = md5.MD5Hasher() self._AssertTestPathStringDigestMatch(hasher, [u'ímynd.dd'], expected_md5) hasher = md5.MD5Hasher() self._AssertTestPathBinaryDigestMatch( hasher, [u'ímynd.dd'], expected_md5.decode(u'hex'))
def testFileHashMatchesEmptyFile(self): """Tests that hasher matches the hash of an empty file.""" expected_md5 = u'd41d8cd98f00b204e9800998ecf8427e' hasher = md5.MD5Hasher() self._AssertTestPathStringDigestMatch(hasher, [u'empty_file'], expected_md5) hasher = md5.MD5Hasher() self._AssertTestPathBinaryDigestMatch( hasher, [u'empty_file'], expected_md5.decode(u'hex'))
def testFileHashMatchesKnownFile(self): """Tests that hasher matches the hash of a known file.""" hasher = md5.MD5Hasher() self._AssertTestPathStringDigestMatch( hasher, ['ímynd.dd'], 'd73c51f10c7ee6a681b7b619ccc6f1c4')
def testFileHashMatchesEmptyFile(self): """Tests that hasher matches the hash of an empty file.""" hasher = md5.MD5Hasher() self._AssertTestPathStringDigestMatch( hasher, ['empty_file'], 'd41d8cd98f00b204e9800998ecf8427e')