def test_secHash_consistent(self): """Tests that secHashFile of a pickled object is the same as secHashObject of the object.""" l = [1, 2, 3] d = dict() d['a'] = l d['b'] = l with TempDir() as tempDir: def loc(suffix): return os.path.join(tempDir.location, suffix) persist.savePickle(loc('d.pickle'), d) assert (persist.secHashFile(loc('d.pickle')) == persist.secHashObject(d))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashFile = persist.secHashFile(self.location) return persist.secHashObject((secHashSource, secHashFile))