def test_rename_workflow(self): workflows = [Workflow(str(i), 0) for i in range(3)] playbook = Playbook('test', workflows) playbook.rename_workflow('2', 'new_name') self.assertTrue(playbook.has_workflow_name('new_name')) self.assertFalse(playbook.has_workflow_name('2'))
def test_rename_workflow_not_found(self): workflows = [Workflow(str(i), 0) for i in range(3)] playbook = Playbook('test', workflows) playbook.rename_workflow('invalid', 'new_name') self.assertFalse(playbook.has_workflow_name('invalid'))
def test_rename_workflow_no_workflows(self): playbook = Playbook('test', []) playbook.rename_workflow('anything', 'renamed') self.assertListEqual(playbook.workflows, [])
def test_rename_workflow(self): workflows = [Workflow(str(i), 0) for i in range(3)] playbook = Playbook('test', workflows) playbook.rename_workflow('2', 'new_name') self.assertTrue(playbook.has_workflow_name('new_name')) self.assertFalse(playbook.has_workflow_name('2'))
def test_rename_workflow_not_found(self): workflows = [Workflow(str(i), 0) for i in range(3)] playbook = Playbook('test', workflows) playbook.rename_workflow('invalid', 'new_name') self.assertFalse(playbook.has_workflow_name('invalid'))
def test_rename_workflow_no_workflows(self): playbook = Playbook('test', []) playbook.rename_workflow('anything', 'renamed') self.assertListEqual(playbook.workflows, [])