Example #1
0
 def test_kwargs_are_added_to_matched_route(self):
     route = Route('/{one}/{two}', 'foo')
     route.match('/1/2')
     self.assertEqual(route.kwargs, {'one': '1', 'two': '2'})
Example #2
0
 def test_returns_true_if_path_matches_route_path(self):
     route = Route('/foo', 'foo')
     self.assertTrue(route.match('/foo'))
Example #3
0
 def test_matches_keyword_arguments(self):
     route = Route('/{foo}/{bar}', 'foobar')
     self.assertTrue(route.match('/fizz/buzz'))
Example #4
0
 def test_returns_false_if_path_does_not_match_route_path(self):
     route = Route('/foo', 'foo')
     self.assertFalse(route.match('/bar'))