Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file or at |
| 4 | # https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | """Tests for the warmup servlet.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | import unittest |
| 12 | |
| 13 | from testing import testing_helpers |
| 14 | |
| 15 | from framework import sql |
| 16 | from framework import warmup |
| 17 | from services import service_manager |
| 18 | |
| 19 | |
| 20 | class WarmupTest(unittest.TestCase): |
| 21 | |
| 22 | def setUp(self): |
| 23 | #self.cache_manager = cachemanager_svc.CacheManager() |
| 24 | #self.services = service_manager.Services( |
| 25 | # cache_manager=self.cache_manager) |
| 26 | self.services = service_manager.Services() |
Adrià Vilanova MartÃnez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame^] | 27 | self.servlet = warmup.Warmup('req', 'res', services=self.services) |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 28 | |
| 29 | |
| 30 | def testHandleRequest_NothingToDo(self): |
| 31 | mr = testing_helpers.MakeMonorailRequest() |
| 32 | actual_json_data = self.servlet.HandleRequest(mr) |
| 33 | self.assertEqual( |
| 34 | {'success': 1}, |
| 35 | actual_json_data) |