def test_has_cycle_two_vertices_linked(): a = Vertex(Vertex._make_test_vertex()) b = Vertex(Vertex._make_test_vertex()) a.add_edge(Edge(b)) b.add_edge(Edge(a)) g = Graph([a, b]) assert g.has_cycle()