#NEWLINE# def test_shortst_path_tree_link( self ) : #NEWLINE# #INDENT# g = Graph ( ) #NEWLINE# g . add_vertex ( 'home' ) #NEWLINE# g . add_vertex ( 'work' ) #NEWLINE# g . add_edge ( 'home' , 'work' , Link ( ) ) #NEWLINE# g . add_edge ( 'work' , 'home' , Link ( ) ) #NEWLINE# spt = g . shortest_path_tree ( 'home' , 'work' , State ( g . numagencies , 0 ) , WalkOptions ( ) ) #NEWLINE# assert g #NEWLINE# assert ( spt . __class__ == ShortestPathTree ) #NEWLINE# assert ( spt . get_vertex ( 'home' ) . outgoing [ 0 ] . payload . __class__ == Link ) #NEWLINE# assert ( spt . get_vertex ( 'work' ) . incoming [ 0 ] . payload . __class__ == Link ) #NEWLINE# assert ( spt . get_vertex ( 'home' ) . degree_out == 1 ) #NEWLINE# assert ( spt . get_vertex ( 'home' ) . degree_in == 0 ) #NEWLINE# assert ( spt . get_vertex ( 'work' ) . degree_in == 1 ) #NEWLINE# assert ( spt . get_vertex ( 'work' ) . degree_out == 0 ) #NEWLINE# spt . destroy ( ) #NEWLINE# g . destroy ( )