def test_taskgraph_limit_tasks(limit): with patch.object(taskcluster.Queue, "listTaskGroup", new=mocked_listTaskGroup): graph = TaskGraph("eShtp2faQgy4iZZOIhXvhw", limit=limit) found_taskids = [task.taskid for task in graph.tasks()] if limit: expected_task_ids = TASK_IDS[:limit] else: expected_task_ids = TASK_IDS assert found_taskids == expected_task_ids
def test_taskgraph_tasks(limit): with patch.object(taskcluster.Queue, 'listTaskGroup', new=mocked_listTaskGroup) as mocked_method: graph = TaskGraph('eShtp2faQgy4iZZOIhXvhw') found_taskids = list() for count, task in enumerate(graph.tasks(limit=limit), start=1): found_taskids.append(task.taskid) if limit: expected_task_ids = TASK_IDS[:limit] else: expected_task_ids = TASK_IDS assert found_taskids == expected_task_ids assert count == len(expected_task_ids)