def test_empty_yml(tmp_path): """ Given: - An empty unified yml When: - calling the add_custom_section when using the -t flag Then: - Check that the function will not raise any errors. """ unifier = IntegrationScriptUnifier(str(tmp_path)) unifier.add_custom_section({})
def test_add_custom_section(tmp_path): ''' Given: - an Integration to unify When: - the --custom flag is True Then: - Add a "Test" to the name/display/id of the integration if the yml exsits. ''' unifier = IntegrationScriptUnifier(str(tmp_path), custom='Test') unified_yml = { 'display': 'Integration display', 'commonfields': {'id': 'Integration id'}, 'name': 'Integration name' } unified = unifier.add_custom_section(unified_yml) assert unified.get('display') == 'Integration display - Test' assert unified.get('name') == 'Integration name - Test' assert unified.get('commonfields').get('id') == 'Integration id - Test'