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
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
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)
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)
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
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