| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 datetime | 5 import datetime |
| 6 import mock | 6 import mock |
| 7 | 7 |
| 8 from testing_utils import testing | 8 from testing_utils import testing |
| 9 | 9 |
| 10 from handlers import index | 10 from handlers import index |
| 11 import main | 11 import main |
| 12 from model.flake import Flake, FlakyRun, FlakeOccurrence | 12 from model.flake import Flake, FlakyRun, FlakeOccurrence |
| 13 from model.build_run import PatchsetBuilderRuns, BuildRun | 13 from model.build_run import PatchsetBuilderRuns, BuildRun |
| 14 | 14 |
| 15 from time_functions.testing import mock_datetime_utc | 15 from infra_libs.time_functions.testing import mock_datetime_utc |
| 16 | 16 |
| 17 | 17 |
| 18 class TestIndex(testing.AppengineTestCase): | 18 class TestIndex(testing.AppengineTestCase): |
| 19 app_module = main.app | 19 app_module = main.app |
| 20 | 20 |
| 21 def test_filter_none(self): | 21 def test_filter_none(self): |
| 22 self.assertEqual([1, 2], index.filterNone([1, None, 2])) | 22 self.assertEqual([1, 2], index.filterNone([1, None, 2])) |
| 23 | 23 |
| 24 def test_smoke(self): | 24 def test_smoke(self): |
| 25 self.test_app.get('/') | 25 self.test_app.get('/') |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 index.Index.index('month') | 96 index.Index.index('month') |
| 97 | 97 |
| 98 @mock_datetime_utc(2016, 6, 6, 10, 20, 30) | 98 @mock_datetime_utc(2016, 6, 6, 10, 20, 30) |
| 99 def test_all_smoke(self): | 99 def test_all_smoke(self): |
| 100 tf = datetime.datetime(2015, 6, 10, 10, 10, 30) | 100 tf = datetime.datetime(2015, 6, 10, 10, 10, 30) |
| 101 ts = tf - datetime.timedelta(hours=1) | 101 ts = tf - datetime.timedelta(hours=1) |
| 102 tf2 = tf - datetime.timedelta(days=300) | 102 tf2 = tf - datetime.timedelta(days=300) |
| 103 ts2 = tf2 - datetime.timedelta(hours=1) | 103 ts2 = tf2 - datetime.timedelta(hours=1) |
| 104 self._create_flakes(ts, tf, ts2, tf2) | 104 self._create_flakes(ts, tf, ts2, tf2) |
| 105 index.Index.index('all') | 105 index.Index.index('all') |
| OLD | NEW |