#NEWLINE# def test_example_code( self ) : #NEWLINE# #INDENT# from py2neo import Graph , Node , Relationship #NEWLINE# from py2neo.ext.calendar import GregorianCalendar #NEWLINE# graph = Graph ( ) #NEWLINE# calendar = GregorianCalendar ( graph ) #NEWLINE# alice = Node ( 'Person' , name = 'Alice' ) #NEWLINE# birth = Relationship ( alice , 'BORN' , calendar . date ( 1800 , 1 , 1 ) . day ) #NEWLINE# death = Relationship ( alice , 'DIED' , calendar . date ( 1900 , 12 , 31 ) . day ) #NEWLINE# graph . create ( ( ( alice | birth ) | alice ) ) #NEWLINE# assert ( birth . end_node ( ) [ 'year' ] == 1800 ) #NEWLINE# assert ( birth . end_node ( ) [ 'month' ] == 1 ) #NEWLINE# assert ( birth . end_node ( ) [ 'day' ] == 1 ) #NEWLINE# assert ( death . end_node ( ) [ 'year' ] == 1900 ) #NEWLINE# assert ( death . end_node ( ) [ 'month' ] == 12 ) #NEWLINE# assert ( death . end_node ( ) [ 'day' ] == 31 )