コード例 #1
0
class PathMapperTests(unittest.TestCase):
  def setUp(self):
    self.path_mapper = PathMapper()
    self.path_mapper.connect('/home', options={ 'controller': 'home', 'action': 'weebles' })
  
  @test
  def should_parse_a_static_url(self):
    self.assertEqual({ 'controller': 'home', 'action': 'weebles' }, self.path_mapper.parse('/home'))
  
  @test
  def should_raise_an_exception_if_parsing_an_unknown_static(self):
    self.assertRaises(NotFoundError, self.path_mapper.parse, '/dingo')
コード例 #2
0
 def setUp(self):
   self.path_mapper = PathMapper()
   self.path_mapper.connect('/home', options={ 'controller': 'home', 'action': 'weebles' })