| 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 mock | 5 import mock |
| 6 import re | 6 import re |
| 7 import urllib | 7 import urllib |
| 8 | 8 |
| 9 import webapp2 | 9 import webapp2 |
| 10 import webtest | 10 import webtest |
| 11 | 11 |
| 12 from google.appengine.api import users | 12 from google.appengine.api import users |
| 13 | 13 |
| 14 from testing_utils import testing | 14 from testing_utils import testing |
| 15 | 15 |
| 16 from common import base_handler | 16 from common import base_handler |
| 17 from common.base_handler import BaseHandler | 17 from common.base_handler import BaseHandler, Permission |
| 18 from common.base_handler import Permission | |
| 19 | 18 |
| 20 | 19 |
| 21 class PermissionLevelHandler(BaseHandler): | 20 class PermissionLevelHandler(BaseHandler): |
| 22 PERMISSION_LEVEL = Permission.ANYONE | 21 PERMISSION_LEVEL = Permission.ANYONE |
| 23 | 22 |
| 24 def HandleGet(self): | 23 def HandleGet(self): |
| 25 pass | 24 pass |
| 26 | 25 |
| 27 | 26 |
| 28 class PermissionTest(testing.AppengineTestCase): | 27 class PermissionTest(testing.AppengineTestCase): |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 app_module = webapp2.WSGIApplication([ | 255 app_module = webapp2.WSGIApplication([ |
| 257 ('/exception', InternalExceptionHandler), | 256 ('/exception', InternalExceptionHandler), |
| 258 ], debug=True) | 257 ], debug=True) |
| 259 | 258 |
| 260 def testInternalException(self): | 259 def testInternalException(self): |
| 261 self.assertRaisesRegexp( | 260 self.assertRaisesRegexp( |
| 262 webtest.app.AppError, | 261 webtest.app.AppError, |
| 263 re.compile('.*500 Internal Server Error.*An internal error occurred.*', | 262 re.compile('.*500 Internal Server Error.*An internal error occurred.*', |
| 264 re.MULTILINE | re.DOTALL), | 263 re.MULTILINE | re.DOTALL), |
| 265 self.test_app.get, '/exception') | 264 self.test_app.get, '/exception') |
| OLD | NEW |