| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 from testing_utils import testing | 5 from testing_utils import testing |
| 6 | 6 |
| 7 from common.git_repository import GitRepository | 7 from common.git_repository import GitRepository |
| 8 from model import analysis_status | 8 from model import analysis_status |
| 9 from model import result_status | 9 from model import result_status |
| 10 from model.wf_analysis import WfAnalysis | 10 from model.wf_analysis import WfAnalysis |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 'tests': { | 923 'tests': { |
| 924 'Test1': { | 924 'Test1': { |
| 925 'revision': 'rev1' | 925 'revision': 'rev1' |
| 926 } | 926 } |
| 927 } | 927 } |
| 928 } | 928 } |
| 929 } | 929 } |
| 930 | 930 |
| 931 self.assertEqual(culprit_map, expected_culprit_map) | 931 self.assertEqual(culprit_map, expected_culprit_map) |
| 932 self.assertEqual(failed_revisions, ['rev1']) | 932 self.assertEqual(failed_revisions, ['rev1']) |
| 933 |
| 934 def testNotifyCulprits(self): |
| 935 instances = [] |
| 936 class Mocked_SendNotificationForCulpritPipeline(object): |
| 937 def __init__(self, *args): |
| 938 self.args = args |
| 939 self.started = False |
| 940 instances.append(self) |
| 941 |
| 942 def start(self): |
| 943 self.started = True |
| 944 |
| 945 self.mock( |
| 946 identify_try_job_culprit_pipeline, 'SendNotificationForCulpritPipeline', |
| 947 Mocked_SendNotificationForCulpritPipeline) |
| 948 |
| 949 culprits = { |
| 950 'r1': { |
| 951 'repo_name': 'chromium', |
| 952 'revision': 'r1', |
| 953 } |
| 954 } |
| 955 |
| 956 identify_try_job_culprit_pipeline._NotifyCulprits('m', 'b', 1, culprits) |
| 957 self.assertEqual(1, len(instances)) |
| 958 self.assertTrue(instances[0].started) |
| OLD | NEW |