def test_section_to_yaml_returns_correct_yaml_when_tools_present(): tools = { 'advpng': '/bin/advpng', 'optipng': '/bin/optipng', } expected = """\ commands: advpng: /bin/advpng optipng: /bin/optipng """ output = helpers.section_to_yaml('commands', tools) assert output == expected
def test_section_to_yaml_returns_empty_string_when_given_no_commands(): output = helpers.section_to_yaml('commands', {}) assert output == ""