def test_multiple_params_trailing_slash_matches(self): parser = UrlParamParser("/fake_route/{resource}/{action}") self.assertTrue(parser.match("/fake_route/moe/smile/"))
def test_multiple_params_no_match_trailing_slash(self): parser = UrlParamParser("/fake_route/{resource}/{action}") self.assertTrue(not parser.match("/not_the_same_route/moe/smile/"))
def test_one_param_no_match_trailing_slash(self): parser = UrlParamParser("/fake_route/{resource}") self.assertTrue(not parser.match("/not_the_same_route/moe/"))
def test_no_params_match(self): parser = UrlParamParser("/fake_route") self.assertTrue(parser.match("/fake_route"))
def test_one_param_matches_trailing_slash(self): parser = UrlParamParser("/fake_route/{resource}") self.assertTrue(parser.match("/fake_route/moe/"))
def test_one_param_matches(self): parser = UrlParamParser("/fake_route/{resource}") self.assertTrue(parser.match("/fake_route/moe"))
def test_no_params_no_match_trailing_slash(self): parser = UrlParamParser("/fake_route") self.assertTrue(not parser.match("/not_the_same_route/"))
def test_missing_params_too_long_does_not_match(self): parser = UrlParamParser("/fake_route/{resource}/{action}") self.assertTrue(not parser.match("/not_the_same_route/moe/smile"))
def test_missing_params_too_short_does_not_match(self): parser = UrlParamParser("/fake_route/{resource}/{action}") self.assertTrue(not parser.match("/fake_route/moe"))