Home | History | Annotate | Download | only in tests
      1 # -*- coding: utf-8 -*-
      2 import webapp2
      3 from webapp2_extras import local_app
      4 
      5 import test_base
      6 
      7 
      8 class TestLocalApp(test_base.BaseTestCase):
      9     def test_dispatch(self):
     10         def hello_handler(request, *args, **kwargs):
     11             return webapp2.Response('Hello, World!')
     12 
     13         app = local_app.WSGIApplication([('/', hello_handler)])
     14         rsp = app.get_response('/')
     15         self.assertEqual(rsp.status_int, 200)
     16         self.assertEqual(rsp.body, 'Hello, World!')
     17 
     18 
     19 if __name__ == '__main__':
     20     test_base.main()
     21