예제 #1
0
파일: checksum.py 프로젝트: kuladip/freezer
    def get_files_hashes_in_path(self):
        """
        Walk the files in path computing the checksum for each one and updates
        the concatenation checksum for the final result
        """
        self.count = utils.walk_path(self.path, self.exclude, self.ignorelinks, self.get_hash)

        return self._increment_hash
예제 #2
0
    def get_files_hashes_in_path(self):
        """
        Walk the files in path computing the checksum for each one and updates
        the concatenation checksum for the final result
        """
        self.count = utils.walk_path(self.path, self.exclude,
                                     self.ignorelinks, self.get_hash)

        return self._increment_hash
예제 #3
0
파일: test_utils.py 프로젝트: mylq/freezer
 def test_walk_path_dir(self, mock_isfile, mock_chdir, mock_walk):
     mock_isfile.return_value = False
     mock_chdir.return_value = None
     mock_walk.return_value = [('.', ['d1', 'd2'], ['f1', 'f2']),
                               ('./d1', [], ['f3']), ('./d2', [], []), ]
     expected = ['.', './f1', './f2', './d1', './d1/f3', './d2']
     files = []
     count = utils.walk_path('root', '', False, self.callback, files=files)
     for i in range(len(files)):
         assert expected[i] == files[i]
     assert count is len(files)
예제 #4
0
 def test_walk_path_dir(self, mock_isfile, mock_chdir, mock_walk):
     mock_isfile.return_value = False
     mock_chdir.return_value = None
     mock_walk.return_value = [('.', ['d1', 'd2'], ['f1', 'f2']),
                               ('./d1', [], ['f3']), ('./d2', [], []), ]
     expected = ['.', './f1', './f2', './d1', './d1/f3', './d2']
     files = []
     count = utils.walk_path('root', '', False, self.callback, files=files)
     for i in range(len(files)):
         assert expected[i] == files[i]
     assert count is len(files)
예제 #5
0
 def test_walk_path_file(self, mock_isfile):
     mock_isfile.return_value = True
     count = utils.walk_path('root', '', False, self.callback)
     assert count is 1
예제 #6
0
 def test_walk_path_file(self, mock_isfile):
     mock_isfile.return_value = True
     count = utils.walk_path('root', '', False, self.callback)
     assert count is 1