def testVertexOutE(self): """ Vertex().outE() should ret a list of the edges that go 'out' from it """ u = Vertex() v = Vertex() e = u >> v self.assertEqual(u.outE(), {e})
def testFiltersOutE(self): """Make sure filters work with Edges, on the outE property""" t = Vertex(name="Frank") u = Vertex(name="Bob") v = Vertex(name="Sally") e1 = t.edgeto(u, weight=4, label="First Edge") e2 = t.edgeto(v, weight=5, label="Second Edge") results = t.outE(weight=5).label self.assertEqual(results, {'Second Edge'})
def testChainingSelectorsWithAttributeAccess(self): """ Chain selectors together and request an attribute at the end of the chain """ t = Vertex() u = Vertex() u.name = "I am U" e = t >> u should_be_i_am_u = t.outE().inV().name self.assertEqual(should_be_i_am_u, {"I am U"})
def testChainingSelectors(self): """Chain {in,out}{_,E,V} calls together""" t = Vertex() u = Vertex() e = t >> u # >>> t.outE() # {e} # >>> e.inV() # {u} should_be_u = t.outE().inV() self.assertEqual(should_be_u, {u})