#NEWLINE# def test_dep_iter( self ) : #NEWLINE# #INDENT# tasks = { #NEWLINE# #INDENT# 't1' : Task ( 't1' , [ '' ] ) , #NEWLINE# 't2' : Task ( 't2' , [ '' ] , task_dep = [ 't1' ] ) , #NEWLINE# 't3' : Task ( 't3' , [ '' ] , setup = [ 't1' ] ) , #NEWLINE# 't4' : Task ( 't4' , [ '' ] , task_dep = [ 't3' ] ) , #NEWLINE# #UNINDENT# } #NEWLINE# def names( sel_tasks , repeated = False ) : #NEWLINE# #INDENT# task_list = tasks_and_deps_iter ( tasks , sel_tasks , repeated ) #NEWLINE# return [ t . name for t in task_list ] #NEWLINE# #UNINDENT# assert ( [ 't1' ] == names ( [ 't1' ] ) ) #NEWLINE# assert ( [ 't2' , 't1' ] == names ( [ 't2' ] ) ) #NEWLINE# assert ( [ 't3' , 't1' ] == names ( [ 't3' ] ) ) #NEWLINE# assert ( [ 't4' , 't3' , 't1' ] == names ( [ 't4' ] ) ) #NEWLINE# assert ( set ( [ 't2' , 't1' ] ) == set ( names ( [ 't1' , 't2' ] ) ) ) #NEWLINE# got = names ( [ 't1' , 't2' ] , True ) #NEWLINE# assert ( 3 == len ( got ) ) #NEWLINE# assert ( 't1' == got [ ( - 1 ) ] )