def test_delete(self): vertex1 = Vertex(1) vertex2 = Vertex(2) edge = Edge(vertex1, vertex2, 3) edge.delete() self.assertNotIn(edge, vertex1.edges) self.assertNotIn(edge, vertex2.edges)
def deleteEdge(self, edge: Edge): self.edges.remove(edge) edge.delete()