OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 from StringIO import StringIO | 7 from StringIO import StringIO |
8 import unittest | 8 import unittest |
9 | 9 |
10 import appengine_memcache as memcache | 10 import appengine_memcache as memcache |
11 import handler | 11 import handler |
12 from handler import Handler | 12 from handler import Handler |
13 | 13 |
14 KNOWN_FAILURES = [ | 14 KNOWN_FAILURES = [ |
15 # Exception in schema compiler (model.py). See http://crbug.com/141279. | |
16 'app.html', | |
17 ] | 15 ] |
18 | 16 |
19 class _MockResponse(object): | 17 class _MockResponse(object): |
20 def __init__(self): | 18 def __init__(self): |
21 self.status = 200 | 19 self.status = 200 |
22 self.out = StringIO() | 20 self.out = StringIO() |
23 | 21 |
24 def set_status(self, status): | 22 def set_status(self, status): |
25 self.status = status | 23 self.status = status |
26 | 24 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 request = _MockRequest('_ah/warmup') | 67 request = _MockRequest('_ah/warmup') |
70 response = _MockResponse() | 68 response = _MockResponse() |
71 Handler(request, response, local_path='../..').get() | 69 Handler(request, response, local_path='../..').get() |
72 self.assertEqual(200, response.status) | 70 self.assertEqual(200, response.status) |
73 # Test that the pages were rendered by checking the size of the output. | 71 # Test that the pages were rendered by checking the size of the output. |
74 # In python 2.6 there is no 'assertGreater' method. | 72 # In python 2.6 there is no 'assertGreater' method. |
75 self.assertTrue(len(response.out.getvalue()) > 500000) | 73 self.assertTrue(len(response.out.getvalue()) > 500000) |
76 | 74 |
77 if __name__ == '__main__': | 75 if __name__ == '__main__': |
78 unittest.main() | 76 unittest.main() |
OLD | NEW |