def test_remove_workflow_by_name_workflow_not_found(self): workflows = [MockWorkflow(i, i + 1) for i in range(3)] playbook = Playbook('test', workflows) playbook.remove_workflow_by_name('invalid') self.assertEqual(len(playbook.workflows), 3)
def test_remove_workflow_by_name(self): workflows = [MockWorkflow(i, i + 1) for i in range(3)] playbook = Playbook('test', workflows) playbook.remove_workflow_by_name(2) self.assertEqual(len(playbook.workflows), 2) self.assertFalse(playbook.has_workflow_name(2))
def test_remove_workflow_by_name_no_workflows(self): playbook = Playbook('test', []) playbook.remove_workflow_by_name('something') self.assertDictEqual(playbook.workflows, {})