Пример #1
0
 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))
Пример #2
0
 def computeSecHash(self):
     secHashSource = codedep.getHash(self.__class__)
     secHashFile = persist.secHashFile(self.location)
     return persist.secHashObject((secHashSource, secHashFile))
Пример #3
0
 def computeSecHash(self):
     secHashSource = codedep.getHash(self.__class__)
     secHashFile = persist.secHashFile(self.location)
     return persist.secHashObject((secHashSource, secHashFile))