def test_workflow_iterator_for_session(self): coll = TaskCollection( jobname='collection', tasks=[Task(jobname='task-%d' % i) for i in range(3)]) coll2 = TaskCollection( jobname='collection-1', tasks=[Task(jobname='task-1-%d' % i) for i in range(3)]) coll.tasks.append(coll2) self.sess.add(coll) assert (['collection', 'task-0', 'task-1', 'task-2', 'collection-1', 'task-1-0', 'task-1-1', 'task-1-2'] == [job.jobname for job in self.sess.iter_workflow()])
def test_standard_session_iterator_for_tasks_and_task_collections(self): coll = TaskCollection(jobname='collection', tasks=[Task() for i in range(3)]) self.sess.add(coll) assert (['collection'] == [job.jobname for job in self.sess])