Example #1
0
 def test_compute_dir(self, mock_hashes):
     """
     Test hashing a directory
     """
     mock_hashes.return_value = self.increment_hash_multi
     chksum = CheckSum('onedir')
     chksum.count = 2
     result = chksum.compute()
     self.assertEquals(self.dir_compute, result)
Example #2
0
 def test_compute_file(self, mock_get_checksum):
     """
     Test compute the checksum of a file
     """
     mock_get_checksum.return_value = self.hello_world_sha256sum
     chksum = CheckSum('onefile')
     chksum.count = 1
     result = chksum.compute()
     self.assertEquals(self.file_compute, result)