<s> import unittest <EOL> from openmdao . main . api import Component , VariableTree , Assembly , set_as_top <EOL> from openmdao . main . datatypes . api import Float , VarTree <EOL> class TstContainer ( VariableTree ) : <EOL> dummy1 = Float ( <NUM_LIT:1.0> ) <EOL> class TstComponent ( Component ) : <EOL> dummy_data = VarTree ( TstContainer ( ) , iotype = '<STR_LIT>' ) <EOL> dummy_data_out = VarTree ( TstContainer ( ) , iotype = '<STR_LIT>' ) <EOL> dummyin = Float ( iotype = '<STR_LIT>' ) <EOL> def execute ( self ) : <EOL> self . dummy_data_out = self . dummy_data . copy ( ) <EOL> class TstAssembly ( Assembly ) : <EOL> def configure ( self ) : <EOL> self . add ( '<STR_LIT>' , TstComponent ( ) ) <EOL> self . create_passthrough ( '<STR_LIT>' ) <EOL> self . create_passthrough ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . driver . workflow . add ( '<STR_LIT>' ) <EOL> class TstAssembly2 ( Assembly ) : <EOL> def configure ( self ) : <EOL> self . add ( '<STR_LIT>' , TstComponent ( ) ) <EOL> self . create_passthrough ( '<STR_LIT>' ) <EOL> self . create_passthrough ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . driver . workflow . add ( '<STR_LIT>' ) <EOL> class VarTreePassthroughTestCase ( unittest . TestCase ) : <EOL> def test_vartree_passthrough ( self ) : <EOL> blah = set_as_top ( TstAssembly ( ) ) <EOL> blah . dummy1 = <NUM_LIT> <EOL> self . assertEqual ( blah . dummy1_out , <NUM_LIT:1.0> ) <EOL> blah . run ( ) <EOL> self . assertEqual ( blah . comp . dummy_data . dummy1 , <NUM_LIT> ) <EOL> self . assertEqual ( blah . dummy1 , <NUM_LIT> ) <EOL> self . assertEqual ( blah . dummy1_out , <NUM_LIT> ) <EOL> def test_vartree_passthrough2 ( self ) : <EOL> blah = set_as_top ( TstAssembly2 ( ) ) <EOL> blah . dummy_data . dummy1 = <NUM_LIT> <EOL> self . assertEqual ( blah . dummy1_out . dummy1 , <NUM_LIT:1.0> ) <EOL> blah . run ( ) <EOL> self . assertEqual ( blah . comp . dummy_data . dummy1 , <NUM_LIT> ) <EOL> self . assertEqual ( blah . dummy_data . dummy1 , <NUM_LIT> ) <EOL> self . assertEqual ( blah . dummy1_out . dummy1 , <NUM_LIT> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
