#NEWLINE# def test_nested( self ) : #NEWLINE# #INDENT# r = gf . Flow ( 'root' ) #NEWLINE# r_1 = test_utils . TaskOneReturn ( 'root.1' ) #NEWLINE# r_2 = test_utils . TaskOneReturn ( 'root.2' ) #NEWLINE# r . add ( r_1 , r_2 ) #NEWLINE# r . link ( r_1 , r_2 ) #NEWLINE# subroot = gf . Flow ( 'subroot' ) #NEWLINE# subroot_r_1 = test_utils . TaskOneReturn ( 'subroot.1' ) #NEWLINE# subroot_r_2 = test_utils . TaskOneReturn ( 'subroot.2' ) #NEWLINE# subroot . add ( subroot_r_1 , subroot_r_2 ) #NEWLINE# subroot . link ( subroot_r_1 , subroot_r_2 ) #NEWLINE# r . add ( subroot ) #NEWLINE# r_3 = test_utils . TaskOneReturn ( 'root.3' ) #NEWLINE# r . add ( r_3 ) #NEWLINE# r . link ( r_2 , r_3 ) #NEWLINE# c = compiler . PatternCompiler ( r ) . compile ( ) #NEWLINE# self . assertEqual ( [ ] , _get_scopes ( c , r_1 ) ) #NEWLINE# self . assertEqual ( [ [ 'root.1' ] ] , _get_scopes ( c , r_2 ) ) #NEWLINE# self . assertEqual ( [ [ 'root.2' , 'root.1' ] ] , _get_scopes ( c , r_3 ) ) #NEWLINE# self . assertEqual ( [ ] , _get_scopes ( c , subroot_r_1 ) ) #NEWLINE# self . assertEqual ( [ [ 'subroot.1' ] ] , _get_scopes ( c , subroot_r_2 ) )