def iterate_pipeline_items(old, new): for line, section, parameter, value in helpers.iterate_parameters(old): if section in pipelines and parameter == "pipeline": items = value.split() yield items new_value = " ".join(items) line = "{0} = {1}\n".format(parameter, new_value) new.write(line)
def unset_default_domain_id(filename): with subprocess.update_file(filename) as (old, new): for line, section, parameter, value in helpers.iterate_parameters(old): if section == "identity" and parameter == "default_domain_id": line = "#{0}".format(line) new.write(line)
def test_iterate_parameters(source, parameters): expected_result = [] for line, params in zip(source, parameters): expected_result.append((line,) + params) result = list(helpers.iterate_parameters(source)) assert result == expected_result