Ejemplo n.º 1
0
 def testMatchingRoute(self):
     adjList = AdjacencyList()
     
     route1 = Route(orig = 1, dest = 2, distance = 20)
     route2 = Route(orig = 1, dest = 3, distance = 40)
     adjList.add(route1)
     adjList.add(route2)
     
     adjList = adjList.removeFromList(orig = 1, dest = 2)
     
     self.assertIsNone(adjList.findRoutePair(orig = 1, dest = 2))
     self.assertEqual(adjList.findRoutePair(orig = 1, dest = 3), route2)
Ejemplo n.º 2
0
 def testNonMatchingRoute(self):
     adjList = AdjacencyList()
     adjList.add(Route(orig = 1, dest = 2, distance = 20))
     self.assertEqual(adjList.removeFromList(orig = 3, dest = 4), adjList)
Ejemplo n.º 3
0
 def testNoRoutes(self):
     adjList = AdjacencyList()
     self.assertTrue(adjList.removeFromList(orig = 1, dest = 2).empty())