def test_merge_sections_missing(configuration: Configuration) -> None: """ must merge create section if not exists """ section = configuration.section_name("build", "x86_64") configuration.remove_section("build") configuration.add_section(section) configuration.set(section, "key", "value") configuration.merge_sections("x86_64") assert configuration.get("build", "key") == "value"
def test_dump_architecture_specific(configuration: Configuration) -> None: """ dump must contain architecture specific settings """ section = configuration.section_name("build", "x86_64") configuration.add_section(section) configuration.set(section, "archbuild_flags", "hello flag") configuration.merge_sections("x86_64") dump = configuration.dump() assert dump assert "build" in dump assert section not in dump assert dump["build"]["archbuild_flags"] == "hello flag"