Exemplo n.º 1
0
    def test_hashFile(self):
        cwd = os.path.dirname(os.path.realpath(__file__))
        imPath = os.path.join(cwd, 'testimages', 'lolcat-oregon-trail.jpg')

        with open(imPath, "rb") as fp:
            fCont = fp.read()

        hexHash = hashFile.getMd5Hash(fCont)

        self.assertEqual(hexHash, "7227289a017988b6bdcf61fd4761f6b9")
	def test_hashFile(self):
		cwd = os.path.dirname(os.path.realpath(__file__))
		imPath = os.path.join(cwd, 'testimages', 'lolcat-oregon-trail.jpg')

		with open(imPath, "rb") as fp:
			fCont = fp.read()


		hexHash = hashFile.getMd5Hash(fCont)

		self.assertEqual(hexHash, "7227289a017988b6bdcf61fd4761f6b9")
    def getFileMd5(self, wholePath):

        with open(wholePath, "rb") as fp:
            fCont = fp.read()
        hexHash = hasher.getMd5Hash(fCont)
        return hexHash, fCont
	def getFileMd5(self, wholePath):

		with open(wholePath, "rb") as fp:
			fCont = fp.read()
		hexHash = hasher.getMd5Hash(fCont)
		return hexHash, fCont