class RouteListTests(unittest.TestCase): def setUp(self): self.route1 = StaticRoute("/home") self.route2 = StaticRoute("/home/about", name="Primero") self.route3 = StaticRoute("/home/about", name="Segundo") self.list = RouteList() self.list.add(self.route1) self.list.add(self.route2) self.list.add(self.route3) @test def should_match_first_route(self): self.assertEqual(self.route2, self.list.match("/home/about"))
def setUp(self): self.route1 = StaticRoute("/home") self.route2 = StaticRoute("/home/about", name="Primero") self.route3 = StaticRoute("/home/about", name="Segundo") self.list = RouteList() self.list.add(self.route1) self.list.add(self.route2) self.list.add(self.route3)