def test_example_code_runs(self): from py2neo import neo4j from py2neo.calendar import GregorianCalendar graph_db = neo4j.GraphDatabaseService() time_index = graph_db.get_or_create_index(neo4j.Node, "TIME") calendar = GregorianCalendar(time_index) alice, birth, death = graph_db.create( {"name": "Alice"}, (0, "BORN", calendar.day(1800, 1, 1)), (0, "DIED", calendar.day(1900, 12, 31)), ) assert birth.end_node["year"] == 1800 assert birth.end_node["month"] == 1 assert birth.end_node["day"] == 1 assert death.end_node["year"] == 1900 assert death.end_node["month"] == 12 assert death.end_node["day"] == 31
def setUp(self): self.calendar = GregorianCalendar(TIME)