def test_get_all_workflows_as_json(self): workflows = [MockWorkflow(i, i + 1) for i in range(3)] playbook = Playbook('test', workflows) workflow_jsons = playbook.get_all_workflow_representations() expected = [{ 'name': i + 1, 'uid': i, 'other': 'other' } for i in range(3)] for workflow_json in workflow_jsons: self.assertIn(workflow_json, expected)
def test_get_all_workflows_as_json_no_workflows(self): playbook = Playbook('test', []) self.assertListEqual(playbook.get_all_workflow_representations(), [])