#NEWLINE# def test_vtree( self ) : #NEWLINE# #INDENT# top = Assembly ( ) #NEWLINE# sub = top . add ( 'sub' , Assembly ( ) ) #NEWLINE# sub . add ( 'comp' , LoadsComp ( ) ) #NEWLINE# sub . driver . workflow . add ( 'comp' ) #NEWLINE# sub . create_passthrough ( 'comp.loads_in' ) #NEWLINE# sub . create_passthrough ( 'comp.loads_out' ) #NEWLINE# top . driver . workflow . add ( 'sub' ) #NEWLINE# jsonfile = os . path . join ( self . tempdir , 'test_vtree.json' ) #NEWLINE# old_json_file = os . path . join ( os . path . dirname ( __file__ ) , 'vtree.json' ) #NEWLINE# top . recorders = [ JSONCaseRecorder ( jsonfile ) ] #NEWLINE# loads = Loads ( ) #NEWLINE# loads . Fx = [ 1 , 2 , 3 ] #NEWLINE# loads . Fy = [ 4 , 5 , 6 ] #NEWLINE# loads . Fz = [ 7 , 8 , 9 ] #NEWLINE# arr = LoadsArray ( ) #NEWLINE# arr . loads = [ loads ] #NEWLINE# top . sub . loads_in = arr #NEWLINE# top . run ( ) #NEWLINE# cdsnew = CaseDataset ( old_json_file , 'json' ) #NEWLINE# cdsold = CaseDataset ( old_json_file , 'json' ) #NEWLINE# ( cdsold . data . vars ( 'sub.comp.loads_out' ) . fetch ( ) [ 0 ] [ 0 ] [ 'loads' ] [ 0 ] [ 'Fx' ] == cdsnew . data . vars ( 'sub.comp.loads_out' ) . fetch ( ) [ 0 ] [ 0 ] [ 'loads' ] [ 0 ] [ 'Fx' ] ) #NEWLINE# ( cdsold . data . vars ( 'sub.comp.loads_out' ) . fetch ( ) [ 1 ] [ 0 ] [ 'loads' ] [ 0 ] [ 'Fz' ] == cdsnew . data . vars ( 'sub.comp.loads_out' ) . fetch ( ) [ 1 ] [ 0 ] [ 'loads' ] [ 0 ] [ 'Fz' ] )