#NEWLINE# def test_edges_matching( self ) : #NEWLINE# #INDENT# g = nx . DiGraph ( ) #NEWLINE# g . add_path ( range ( 10 ) , foo = True , bar = False ) #NEWLINE# g . edge [ 2 ] [ 3 ] [ 'baz' ] = True #NEWLINE# g . edge [ 5 ] [ 6 ] [ 'baz' ] = True #NEWLINE# g . edge [ 5 ] [ 6 ] [ 'bar' ] = True #NEWLINE# self . assertEqual ( set ( edges_matching_all ( g , foo = True , bar = False ) ) , ( set ( g . edges ( ) ) - set ( [ ( 5 , 6 ) ] ) ) ) #NEWLINE# self . assertEqual ( set ( edges_matching_all ( g , foo = True ) ) , set ( g . edges ( ) ) ) #NEWLINE# self . assertEqual ( set ( edges_matching_all ( g , foo = False , baz = True ) ) , set ( ) ) #NEWLINE# self . assertEqual ( set ( edges_matching_all ( g , foo = True , baz = True ) ) , set ( [ ( 2 , 3 ) , ( 5 , 6 ) ] ) ) #NEWLINE# self . assertEqual ( set ( edges_matching_some ( g , baz = True , bar = True ) ) , set ( [ ( 2 , 3 ) , ( 5 , 6 ) ] ) ) #NEWLINE# self . assertEqual ( set ( edges_matching_some ( g , foo = False , baz = False ) ) , set ( ) )