Example #1
0
 def _mock_add_files_side_effect_remove_files(file_set, _2, index_iterable, **kwargs):
     """Mock the logical behavior of add_files on the given file_set argument."""
     preserve_gaps = kwargs.get('preserve_gaps', False)
     strip_gaps = kwargs.get('strip_gaps', False)
     
     if preserve_gaps and strip_gaps:
         raise FileSet.ConflictingOptionsError()
     elif preserve_gaps or strip_gaps:
         for index in index_iterable:
             file_set.files.pop(index, None)
     else:
         for index in index_iterable:
             removal_result = file_set.files.pop(index, None)
             if removal_result is None:
                 raise FileSet.IndexUnassignedError(index, "The index {} is unassigned and thus can't be added to the set.".format(index))