def test_degree(self): """Tests the degree methods in a graph. """ graph = Graph(graph = { 'A' : ['B', 'C'], 'B' : ['A'], 'C' : [] }) self.assertEqual(graph.interior_degree('A'), 1, 'There is 1 edge coming to A.') self.assertEqual(graph.exterior_degree('A'), 2, 'There are 2 edges extending from A.') self.assertEqual(graph.degree('A'), 3, 'There are 3 edges from and to A.')