#NEWLINE# def test_unorderable_nodes( self ) : #NEWLINE# #INDENT# 'Tests that A* accomodates nodes that are not orderable.\n\n        For more information, see issue #554.\n\n        ' #NEWLINE# class Unorderable ( object ) : #NEWLINE# #INDENT# def __le__( self ) : #NEWLINE# #INDENT# raise NotImplemented #NEWLINE# #UNINDENT# def __ge__( self ) : #NEWLINE# #INDENT# raise NotImplemented #NEWLINE# #UNINDENT# #UNINDENT# nodes = [ Unorderable ( ) for n in range ( 4 ) ] #NEWLINE# G = nx . Graph ( ) #NEWLINE# G . add_edges_from ( pairwise ( n , cyclic = True ) ) #NEWLINE# path = nx . astar_path ( G , nodes [ 0 ] , nodes [ 2 ] ) #NEWLINE# assert_equal ( len ( path ) , 3 )