| 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 copy | 5 import copy |
| 6 import datetime | 6 import datetime |
| 7 import mock | 7 import mock |
| 8 | 8 |
| 9 import webapp2 | 9 import webapp2 |
| 10 | 10 |
| 11 from common.waterfall import failure_type | 11 from common.waterfall import failure_type |
| 12 from handlers import calculate_confidence_scores | 12 from handlers import calculate_confidence_scores |
| 13 from lib import time_util | 13 from libs import time_util |
| 14 from model import analysis_approach_type | 14 from model import analysis_approach_type |
| 15 from model import suspected_cl_status | 15 from model import suspected_cl_status |
| 16 from model.suspected_cl_confidence import ConfidenceInformation | 16 from model.suspected_cl_confidence import ConfidenceInformation |
| 17 from model.wf_suspected_cl import WfSuspectedCL | 17 from model.wf_suspected_cl import WfSuspectedCL |
| 18 from waterfall.test import wf_testcase | 18 from waterfall.test import wf_testcase |
| 19 | 19 |
| 20 | 20 |
| 21 APPROACH_MAP = { | 21 APPROACH_MAP = { |
| 22 0: [analysis_approach_type.HEURISTIC], | 22 0: [analysis_approach_type.HEURISTIC], |
| 23 1: [analysis_approach_type.TRY_JOB], | 23 1: [analysis_approach_type.TRY_JOB], |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 self.assertEqual(EXPECTED_CONFIDENCE, confidence_object.compile_heuristic) | 169 self.assertEqual(EXPECTED_CONFIDENCE, confidence_object.compile_heuristic) |
| 170 | 170 |
| 171 @mock.patch.object(calculate_confidence_scores, '_SavesNewCLConfidence') | 171 @mock.patch.object(calculate_confidence_scores, '_SavesNewCLConfidence') |
| 172 def testHandleGet(self, mock_fn): | 172 def testHandleGet(self, mock_fn): |
| 173 | 173 |
| 174 mock_fn.return_value = None | 174 mock_fn.return_value = None |
| 175 | 175 |
| 176 self.mock_current_user(user_email='test@chromium.org', is_admin=True) | 176 self.mock_current_user(user_email='test@chromium.org', is_admin=True) |
| 177 response = self.test_app.get('/calculate-confidence-scores') | 177 response = self.test_app.get('/calculate-confidence-scores') |
| 178 self.assertEqual(200, response.status_int) | 178 self.assertEqual(200, response.status_int) |
| OLD | NEW |