#NEWLINE# def test_graph_nested_requires( self ) : #NEWLINE# #INDENT# a = test_utils . ProvidesRequiresTask ( 'a' , provides = [ 'x' ] , requires = [ ] ) #NEWLINE# b = test_utils . ProvidesRequiresTask ( 'b' , provides = [ ] , requires = [ ] ) #NEWLINE# c = test_utils . ProvidesRequiresTask ( 'c' , provides = [ ] , requires = [ 'x' ] ) #NEWLINE# inner_flo = lf . Flow ( 'test2' ) . add ( b , c ) #NEWLINE# flo = gf . Flow ( 'test' ) . add ( a , c ) #NEWLINE# g = _replicate_graph_with_names ( compiler . PatternCompiler ( flo ) . compile ( ) ) #NEWLINE# self . assertEqual ( 7 , len ( g ) ) #NEWLINE# self . assertItemsEqual ( g . edges ( data = True ) , [ ( 'test' , 'a' , { #NEWLINE# #INDENT# 'invariant' : True , #NEWLINE# #UNINDENT# } ) , ( 'test2' , 'b' , { #NEWLINE# #INDENT# 'invariant' : True , #NEWLINE# #UNINDENT# } ) , ( 'a' , 'test2' , { #NEWLINE# #INDENT# 'reasons' : set ( [ 'x' ] ) , #NEWLINE# #UNINDENT# } ) , ( 'b' , 'c' , { #NEWLINE# #INDENT# 'invariant' : True , #NEWLINE# #UNINDENT# } ) , ( 'c' , 'test2[$]' , { #NEWLINE# #INDENT# 'invariant' : True , #NEWLINE# #UNINDENT# } ) , ( 'test2[$]' , 'test[$]' , { #NEWLINE# #INDENT# 'invariant' : True , #NEWLINE# #UNINDENT# } ) ] ) #NEWLINE# self . assertItemsEqual ( [ 'test' ] , list ( g . no_predecessors_iter ( ) ) ) #NEWLINE# self . assertItemsEqual ( [ 'test[$]' ] , list ( g . no_successors_iter ( ) ) )