示例#1
0
 def test_sha1sum(self):
     text = 'sha1 checksum test'
     hasher = hashlib.sha1()
     with NamedTemporaryFile(delete=False) as tf:
         write(tf, text)
         tf.flush()
         self.assertEqual(util.sha1sum(tf.name),
                          update_hasher(hasher, text).hexdigest())
         self.paths_to_delete.append(tf.name)
示例#2
0
 def actual_checksum(self):
     """
     The actual checksum of this artifact. Will be computed and cached.
     """
     return sha1sum(self.filename)