Example #1
0
 def test_regex_path_with_type(self):
     view = View()
     view.bind('/users/<id:int>')
     expected_path = re.compile('^/users/(?P<id>.*?)$')
     self.assertEqual(view, views._regex_pathes[expected_path])
     self.assertEqual(1, len(views._regex_pathes[expected_path]._path_params))
     self.assertEqual(int, views._regex_pathes[expected_path]._path_params['id'])
Example #2
0
 def test_absolute_path(self):
     view = View()
     view.bind('/users')
     self.assertEqual(view, views._abs_pathes['/users'])