1# -*- coding: utf-8 -*-
2import webapp2
3from webapp2_extras import local_app
4
5import test_base
6
7
8class 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
19if __name__ == '__main__':
20    test_base.main()
21