#NEWLINE# def test_davis_southern_women_detail_3_and_4( ) : #NEWLINE# #INDENT# solution = { #NEWLINE# #INDENT# 3 : [ { 'Nora Fayette' , 'E10' , 'Myra Liddel' , 'E12' , 'E14' , 'Frances Anderson' , 'Evelyn Jefferson' , 'Ruth DeSand' , 'Helen Lloyd' , 'Eleanor Nye' , 'E9' , 'E8' , 'E5' , 'E4' , 'E7' , 'E6' , 'E1' , 'Verne Sanderson' , 'E3' , 'E2' , 'Theresa Anderson' , 'Pearl Oglethorpe' , 'Katherina Rogers' , 'Brenda Rogers' , 'E13' , 'Charlotte McDowd' , 'Sylvia Avondale' , 'Laura Mandeville' } ] , #NEWLINE# 4 : [ { 'Nora Fayette' , 'E10' , 'Verne Sanderson' , 'E12' , 'Frances Anderson' , 'Evelyn Jefferson' , 'Ruth DeSand' , 'Helen Lloyd' , 'Eleanor Nye' , 'E9' , 'E8' , 'E5' , 'E4' , 'E7' , 'E6' , 'Myra Liddel' , 'E3' , 'Theresa Anderson' , 'Katherina Rogers' , 'Brenda Rogers' , 'Charlotte McDowd' , 'Sylvia Avondale' , 'Laura Mandeville' } ] , #NEWLINE# #UNINDENT# } #NEWLINE# G = nx . davis_southern_women_graph ( ) #NEWLINE# result = nx . k_components ( G ) #NEWLINE# for ( k , components ) in result . items ( ) : #NEWLINE# #INDENT# if ( k < 3 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# assert_true ( ( len ( components ) == len ( solution [ k ] ) ) ) #NEWLINE# for component in components : #NEWLINE# #INDENT# assert_true ( ( component in solution [ k ] ) )