def test_get_vertex(self): graph = MyGraph('graph_testinput1.txt') self.assertEqual(graph.get_vertex("1").key, "1") self.assertEqual( graph.get_vertex("1").adjacent_to, ["2", "3", "4", "5"])
def test_add_vertex(self): graph = MyGraph('graph_testinput2.txt') graph.add_vertex("9") self.assertEqual(graph.get_vertex("9").key, "9") self.assertEqual(graph.get_vertex("9").adjacent_to, [])
def test_get_vertex_none(self): graph = MyGraph('graph_testinput1.txt') self.assertEqual(None, graph.get_vertex("10"))