#NEWLINE# def test_add_subvar( self ) : #NEWLINE# #INDENT# ( dep , scope ) = _make_graph ( comps = [ 'A' , 'B' ] , variables = [ ( 'b' , 'in' ) , ( 'c' , 'out' ) ] , connections = [ ] , inputs = [ 'a' , 'b' ] , outputs = [ 'c' , 'd' ] ) #NEWLINE# subvar = 'B.b[1]' #NEWLINE# self . assertTrue ( ( subvar not in dep . node ) ) #NEWLINE# dep . add_subvar ( subvar ) #NEWLINE# self . assertTrue ( ( subvar in dep . node ) ) #NEWLINE# self . assertTrue ( ( 'B.b' in dep . successors ( subvar ) ) ) #NEWLINE# subvar = 'b[1]' #NEWLINE# self . assertTrue ( ( subvar not in dep . node ) ) #NEWLINE# dep . add_subvar ( subvar ) #NEWLINE# self . assertTrue ( ( subvar in dep . node ) ) #NEWLINE# self . assertTrue ( ( 'b' in dep . predecessors ( subvar ) ) ) #NEWLINE# subvar = 'B.c[1]' #NEWLINE# self . assertTrue ( ( subvar not in dep . node ) ) #NEWLINE# dep . add_subvar ( subvar ) #NEWLINE# self . assertTrue ( ( subvar in dep . node ) ) #NEWLINE# self . assertTrue ( ( 'B.c' in dep . predecessors ( subvar ) ) ) #NEWLINE# subvar = 'c[1]' #NEWLINE# self . assertTrue ( ( subvar not in dep . node ) ) #NEWLINE# dep . add_subvar ( subvar ) #NEWLINE# self . assertTrue ( ( subvar in dep . node ) ) #NEWLINE# self . assertTrue ( ( 'c' in dep . successors ( subvar ) ) )