| 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 'webstore.html', | 15 'webstore.html', |
| 16 'app.html' |
| 16 ] | 17 ] |
| 17 | 18 |
| 18 class _MockResponse(object): | 19 class _MockResponse(object): |
| 19 def __init__(self): | 20 def __init__(self): |
| 20 self.status = 200 | 21 self.status = 200 |
| 21 self.out = StringIO() | 22 self.out = StringIO() |
| 22 | 23 |
| 23 def set_status(self, status): | 24 def set_status(self, status): |
| 24 self.status = status | 25 self.status = status |
| 25 | 26 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 55 request = _MockRequest('_ah/warmup') | 56 request = _MockRequest('_ah/warmup') |
| 56 response = _MockResponse() | 57 response = _MockResponse() |
| 57 Handler(request, response, local_path='../..').get() | 58 Handler(request, response, local_path='../..').get() |
| 58 self.assertEqual(200, response.status) | 59 self.assertEqual(200, response.status) |
| 59 # Test that the pages were rendered by checking the size of the output. | 60 # Test that the pages were rendered by checking the size of the output. |
| 60 # In python 2.6 there is no 'assertGreater' method. | 61 # In python 2.6 there is no 'assertGreater' method. |
| 61 self.assertTrue(len(response.out.getvalue()) > 500000) | 62 self.assertTrue(len(response.out.getvalue()) > 500000) |
| 62 | 63 |
| 63 if __name__ == '__main__': | 64 if __name__ == '__main__': |
| 64 unittest.main() | 65 unittest.main() |
| OLD | NEW |