def test_graph_one_vertex(self):
     g1 = Graph()
     print('empty graph= ', g1)
     self.assertEqual(str(g1), 'Graph: number of vertices= 0')
     v1 = Vertex('Robert')
     g1.addVertex(v1)
     print(g1)
     self.assertEqual(str(g1), 'Graph: number of vertices= 1')
     print('number of vertices: {0}'.format(g1.getNumberOfVertices()))
     self.assertEqual(g1.getNumberOfVertices(), 1)
     print(g1.getLastVertex().getWeight())
     self.assertEqual(str(g1.getLastVertex().getWeight()),
                      'Vertex: vertex= Robert')
     print(g1.getVertex(0).getWeight())
     self.assertEqual(str(g1.getVertex(0).getWeight()),
                      'Vertex: vertex= Robert')
 def test_graph_two_vertexs(self):
     g1 = Graph()
     v1 = Vertex('Robert')
     v2 = Vertex('Francois')
     g1.addVertex(v1)
     g1.addVertex(v2)
     print('number of vertices: {0}'.format(g1.getNumberOfVertices()))
     self.assertEqual(g1.getNumberOfVertices(), 2)
     print('number of edges: {0}'.format(g1.getNumberOfEdges()))
     self.assertEqual(g1.getNumberOfEdges(), 1)
     print(g1.getLastVertex().getWeight())