#NEWLINE# def test_barbell( ) : #NEWLINE# #INDENT# G = nx . barbell_graph ( 8 , 4 ) #NEWLINE# nx . add_path ( G , [ 7 , 20 , 21 , 22 ] ) #NEWLINE# nx . add_cycle ( G , [ 22 , 23 , 24 , 25 ] ) #NEWLINE# pts = set ( nx . articulation_points ( G ) ) #NEWLINE# assert_equal ( pts , { 7 , 8 , 9 , 10 , 11 , 12 , 20 , 21 , 22 } ) #NEWLINE# answer = [ { 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 } , { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 } , { 22 , 23 , 24 , 25 } , { 11 , 12 } , { 10 , 11 } , { 9 , 10 } , { 8 , 9 } , { 7 , 8 } , { 21 , 22 } , { 20 , 21 } , { 7 , 20 } ] #NEWLINE# assert_components_equal ( list ( nx . biconnected_components ( G ) ) , answer ) #NEWLINE# G . add_edge ( 2 , 17 ) #NEWLINE# pts = set ( nx . articulation_points ( G ) ) #NEWLINE# assert_equal ( pts , { 7 , 20 , 21 , 22 } )