#NEWLINE# def test_link_creation( self ) : #NEWLINE# #INDENT# traj = Trajectory ( ) #NEWLINE# traj . f_add_parameter_group ( 'test.test3' ) #NEWLINE# traj . f_add_parameter_group ( 'test2' ) #NEWLINE# with self . assertRaises ( AttributeError ) : #NEWLINE# #INDENT# traj . par . f_add_link ( 'test' , traj . test2 ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# traj . f_add_link ( 'parameters' , traj . test ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# traj . f_add_link ( 'kkkk' , PickleResult ( 'fff' , 555 ) ) #NEWLINE# #UNINDENT# traj . test . f_add_link ( 'circle1' , traj . test2 ) #NEWLINE# traj . test2 . f_add_link ( 'circle2' , traj . test ) #NEWLINE# self . assertTrue ( ( traj . test . circle1 . circle2 . circle1 . circle2 is traj . test ) ) #NEWLINE# traj . f_add_link ( 'hh' , traj . test ) #NEWLINE# traj . par . f_add_link ( 'overview' , traj . test ) #NEWLINE# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# traj . f_add_link ( 'overview' , traj . test ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# traj . f_add_link ( 'v_crun' ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# traj . par . f_add_link ( 'gg' , traj ) #NEWLINE# #UNINDENT# with self . assertRaises ( AttributeError ) : #NEWLINE# #INDENT# traj . f_add_parameter ( 'test.circle1.testy' , 33 ) #NEWLINE# #UNINDENT# traj . par . f_add_link ( 'gg' , traj . circle1 ) #NEWLINE# self . assertTrue ( ( traj . gg is traj . test2 ) ) #NEWLINE# self . assertTrue ( ( traj . test2 . test3 is traj . par . test . test3 ) ) #NEWLINE# traj . f_add_link ( traj . test3 ) #NEWLINE# self . assertTrue ( ( 'test3' in traj . _links ) )