Skip to content
Browse files

I think this is a bug fix

  • Loading branch information...
1 parent 67162ce commit 1d2644f24911750bf86fd5b5e9b7d5ff87c69026 Matthew Williams committed Feb 9, 2012
Showing with 16 additions and 1 deletion.
  1. +1 −1 src/py2neo/neo4j.py
  2. +15 −0 test/py2neo/neo4j_test.py
View
2 src/py2neo/neo4j.py
@@ -551,7 +551,7 @@ def traverse(self, order=None, uniqueness=None, relationships=None, prune=None,
else:
td = td.relationships(*relationship)
if prune:
- td = td.prune(prune[0], prune[1])
+ td = td.prune_evaluator(prune[0], prune[1])
if filter:
td = td.filter(filter[0], filter[1])
if max_depth:
View
15 test/py2neo/neo4j_test.py
@@ -114,11 +114,26 @@ def test_create_relationships(self):
])
self.gdb.delete(*rels)
self.assertEqual(len(self.nodes), len(rels))
+
+ def test_simple_traverse(self):
+ td = None
+ rel0 = self.nodes[0].create_relationship_to(self.nodes[1], "FLINTSTONE", {})
+ rel1 = self.nodes[1].create_relationship_to(self.nodes[2], "FLINTSTONE", {})
+ #Created Relationship Fred -> Wilma -> Barney
+ td = self.nodes[0].traverse(order = "depth_first",
+ relationships = ("FLINTSTONE",),
+ prune = ("javascript", "position.endNode().getProperty('name') == 'Barney';"),
+ max_depth=2)
+
+ self.assertEquals(len(td.nodes), 2)
+ self.gdb.delete(rel0)
+ self.gdb.delete(rel1)
def tearDown(self):
self.gdb.delete(*self.nodes)
+
class IndexTestCase(unittest.TestCase):
def setUp(self):

1 comment on commit 1d2644f

@nigelsmall

Yes, looks like you're right... also spotted that line 556 should be:

td = td.return_filter(filter[0], filter[1])

instead of

td = td.filter(filter[0], filter[1])
Please sign in to comment.
Something went wrong with that request. Please try again.