def test_should_populate_executable_in_function_if_missing(self): software = {"functions": [{"script_name": "script_name", "args": ["args1", "args2"]}]} expected = dict(software) expected["exported_functions"] = [ {"script_name": "script_name", "executable": "script_name", "args": ["args1", "args2"]}] function_enrichments(software) self.assertEqual(software, expected)
def test_should_combine_styles(self): software = {"functions": ["script_name", {"script_name": "script_name2"}]} expected = dict(software) expected["exported_functions"] = [{"script_name": "script_name", "executable": "script_name", "args": []}, {"script_name": "script_name2", "executable": "script_name2", "args": []}] function_enrichments(software) self.assertEqual(software, expected)
def test_should_copy_function_map(self): software = { "functions": [{"script_name": "script_name", "executable": "executable", "args": ["args1", "args2"]}]} expected = dict(software) expected["exported_functions"] = expected["functions"] function_enrichments(software) self.assertEqual(software, expected)