def __getMd5(self, file): """Returns the MD5 sum of the specified file.""" retVal = "?" * 32 try: retVal = checksum(file, self.__MD5_CHUNK_SIZE) except IOError, ioe: self.__alert("ERROR: Unable to open %s for reading. Error: %s" % (file,ioe))
def test_simple_hash(self): self.assertEquals(checksum(StringIO('this is a test'), algorithm="sha256"), '2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c')
def test_simple_hash(self): self.assertEquals( checksum(StringIO('this is a test'), algorithm="sha256"), '2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c')