Ejemplo n.º 1
0
 def test_flash_message(self):
     controller = SampleActionController()
     controller.request = Request('GET')
     controller.flash_messages.add('testing')
     controller.flash_messages.add('something')
     assert controller.flash_messages['info'] == ['testing', 'something']
     for namespace, message in controller.flash_messages:
         assert namespace == 'info'
     assert not controller.flash_messages.messages
Ejemplo n.º 2
0
 def test_method_template(self):
     controller = SampleActionController()
     assert controller.get_execute_method_path(
         action='something') == ['sampleactioncontroller', 'something']
Ejemplo n.º 3
0
 def test_execute_result(self):
     controller = SampleActionController()
     assert controller.execute(action='something') == 'something_action'
     assert controller.execute(action='blah') == 'blah_action'
Ejemplo n.º 4
0
 def test_repr(self):
     controller = SampleActionController()
     assert repr(
         controller) == '<tests.watson.mvc.support.SampleActionController>'