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 testVertexEdgeToWithOtherProperties(self): """Make sure you can set other properties on the edge""" t = Vertex() u = Vertex() e = t.edgeto(u, weight=5, label="First Edge") self.assertEqual(e.label, "First Edge")
def testVertexEdgeToWithWeight(self): """Connect 2 Vertices with an edge, and give the edge a weight""" u = Vertex() v = Vertex() e = u.edgeto(v, weight=5) self.assertEqual(e.weight, 5)
def testVertexEdgeTo(self): """Connect 2 Vertices with an edge""" u = Vertex() v = Vertex() e = u.edgeto(v) self.assertIsInstance(e, Edge) self.assertEqual(e.from_, u) self.assertEqual(e.to, v)