Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2824)

Unified Diff: dashboard/dashboard/bisect_fyi_test.py

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/auto_triage_test.py ('k') | dashboard/dashboard/delete_old_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/bisect_fyi_test.py
diff --git a/dashboard/dashboard/bisect_fyi_test.py b/dashboard/dashboard/bisect_fyi_test.py
index 5fe244b6666bdd9065c80766600098a30e130ae4..5019087302c32b5f4506866fe827a681391469c5 100644
--- a/dashboard/dashboard/bisect_fyi_test.py
+++ b/dashboard/dashboard/bisect_fyi_test.py
@@ -9,10 +9,12 @@ import webapp2
import webtest
from dashboard import bisect_fyi
+from dashboard import issue_tracker_service
from dashboard import namespaced_stored_object
from dashboard import start_try_job
from dashboard import stored_object
from dashboard import testing_common
+from dashboard import utils
TEST_FYI_CONFIGS = {
'positive_culprit': {
@@ -59,6 +61,8 @@ TEST_FYI_CONFIGS = {
}
+@mock.patch('apiclient.discovery.build', mock.MagicMock())
+@mock.patch.object(utils, 'ServiceAccountCredentials', mock.MagicMock())
class BisectFYITest(testing_common.TestCase):
def setUp(self):
@@ -79,19 +83,24 @@ class BisectFYITest(testing_common.TestCase):
}
})
+ @mock.patch.object(
+ issue_tracker_service.IssueTrackerService, 'AddBugComment')
@mock.patch.object(bisect_fyi.start_try_job, '_PerformBuildbucketBisect')
- def testPost_FailedJobs_BisectFYI(self, mock_perform_bisect):
+ def testPost_FailedJobs_BisectFYI(self, mock_perform_bisect, _):
mock_perform_bisect.return_value = {'error': 'PerformBisect Failed'}
self.testapp.post('/bisect_fyi')
messages = self.mail_stub.get_sent_messages()
self.assertEqual(1, len(messages))
+ @mock.patch.object(
+ issue_tracker_service.IssueTrackerService, 'AddBugComment')
@mock.patch.object(bisect_fyi.start_try_job, '_PerformBuildbucketBisect')
- def testPost_SuccessJobs_BisectFYI(self, mock_perform_bisect):
+ def testPost_SuccessJobs_BisectFYI(self, mock_perform_bisect, mock_comment):
mock_perform_bisect.return_value = {'issue_id': 'http://fake'}
self.testapp.post('/bisect_fyi')
messages = self.mail_stub.get_sent_messages()
self.assertEqual(0, len(messages))
+ mock_comment.assert_called_with(222, mock.ANY, send_email=False)
if __name__ == '__main__':
« no previous file with comments | « dashboard/dashboard/auto_triage_test.py ('k') | dashboard/dashboard/delete_old_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698