OLD | NEW |
(Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import logging |
| 6 import os |
| 7 import webapp2 |
| 8 |
| 9 from testing_utils import testing |
| 10 |
| 11 import common |
| 12 |
| 13 |
| 14 class TestHandler(common.BaseHandler): |
| 15 def get(self): |
| 16 self.render_response('main.html', title='Test') |
| 17 |
| 18 |
| 19 _app = webapp2.WSGIApplication([(r'/', TestHandler)], debug=True) |
| 20 |
| 21 |
| 22 class CommonTest(testing.AppengineTestCase): |
| 23 |
| 24 @property |
| 25 def app_module(self): |
| 26 return _app |
| 27 |
| 28 def test_payload_stats(self): |
| 29 data = 'c00kedbeef' |
| 30 res = "type=<type 'str'>, 10 bytes, md5=407ab662183805731696989975459a9f" |
| 31 self.assertEquals(res, common.payload_stats(data)) |
| 32 |
| 33 def test_base_handler(self): |
| 34 response = self.test_app.get('/') |
| 35 logging.info('response = %s', response) |
| 36 self.assertEquals(200, response.status_int) |
OLD | NEW |