| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import re | 5 import re |
| 6 import urllib | 6 import urllib |
| 7 | 7 |
| 8 import webapp2 | 8 import webapp2 |
| 9 import webtest | 9 import webtest |
| 10 | 10 |
| 11 from testing_utils import testing | 11 from testing_utils import testing |
| 12 | 12 |
| 13 from common import base_handler | 13 from common import base_handler |
| 14 from common.base_handler import BaseHandler | 14 from common.base_handler import BaseHandler, Permission |
| 15 from common.base_handler import Permission | |
| 16 | 15 |
| 17 | 16 |
| 18 class PermissionLevelHandler(BaseHandler): | 17 class PermissionLevelHandler(BaseHandler): |
| 19 PERMISSION_LEVEL = Permission.ANYONE | 18 PERMISSION_LEVEL = Permission.ANYONE |
| 20 | 19 |
| 21 def HandleGet(self): | 20 def HandleGet(self): |
| 22 pass | 21 pass |
| 23 | 22 |
| 24 | 23 |
| 25 class PermissionTest(testing.AppengineTestCase): | 24 class PermissionTest(testing.AppengineTestCase): |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 app_module = webapp2.WSGIApplication([ | 235 app_module = webapp2.WSGIApplication([ |
| 237 ('/exception', InternalExceptionHandler), | 236 ('/exception', InternalExceptionHandler), |
| 238 ], debug=True) | 237 ], debug=True) |
| 239 | 238 |
| 240 def testInternalException(self): | 239 def testInternalException(self): |
| 241 self.assertRaisesRegexp( | 240 self.assertRaisesRegexp( |
| 242 webtest.app.AppError, | 241 webtest.app.AppError, |
| 243 re.compile('.*500 Internal Server Error.*An internal error occurred.*', | 242 re.compile('.*500 Internal Server Error.*An internal error occurred.*', |
| 244 re.MULTILINE | re.DOTALL), | 243 re.MULTILINE | re.DOTALL), |
| 245 self.test_app.get, '/exception') | 244 self.test_app.get, '/exception') |
| OLD | NEW |