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

Side by Side Diff: appengine/chromium_rietveld/tests/test_utils.py

Issue 2128173005: Rietveld: don't email on "Dry Run: CQ is trying da patch" (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix. 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 unified diff | Download patch
« no previous file with comments | « appengine/chromium_rietveld/codereview/views.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 Google Inc. 2 # Copyright 2016 Google Inc.
3 # 3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License. 5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at 6 # You may obtain a copy of the License at
7 # 7 #
8 # http://www.apache.org/licenses/LICENSE-2.0 8 # http://www.apache.org/licenses/LICENSE-2.0
9 # 9 #
10 # Unless required by applicable law or agreed to in writing, software 10 # Unless required by applicable law or agreed to in writing, software
(...skipping 30 matching lines...) Expand all
41 msg += '\n' 41 msg += '\n'
42 self.assertEqual(utils.parse_cq_status_url_message(msg), (url, 213, 1)) 42 self.assertEqual(utils.parse_cq_status_url_message(msg), (url, 213, 1))
43 msg = 'Dry run: ' + msg 43 msg = 'Dry run: ' + msg
44 self.assertEqual(utils.parse_cq_status_url_message(msg), (url, 213, 1)) 44 self.assertEqual(utils.parse_cq_status_url_message(msg), (url, 213, 1))
45 45
46 def test_parse_cq_status_url_message_fail(self): 46 def test_parse_cq_status_url_message_fail(self):
47 self.assertEqual(utils.parse_cq_status_url_message(''), (None, None, None)) 47 self.assertEqual(utils.parse_cq_status_url_message(''), (None, None, None))
48 msg = 'Dry run failed because https://weird.url/patch-status/123/4' 48 msg = 'Dry run failed because https://weird.url/patch-status/123/4'
49 self.assertEqual(utils.parse_cq_status_url_message(msg), (None, None, None)) 49 self.assertEqual(utils.parse_cq_status_url_message(msg), (None, None, None))
50 50
51 def test_is_cq_dry_run_start_message(self):
52 self.assertTrue(utils.is_cq_dry_run_start_message(
53 'Dry Run: CQ is trying da patch. Follow status at\n\nhttps://u.r/l'))
54 self.assertTrue(utils.is_cq_dry_run_start_message(
55 'Dry Run: CQ is trying da patch.\nReference: codereview/xxxx/yyy'))
56
57 self.assertFalse(utils.is_cq_dry_run_start_message(
58 'CQ is trying da patch. Follow status at\n\nhttps://u.r/l'))
59 self.assertFalse(utils.is_cq_dry_run_start_message(
60 'Dry run: Try jobs failed...'))
61 self.assertFalse(utils.is_cq_dry_run_start_message(
62 'Try jobs failed because builder name is Dry Run...'))
63
64 def test_is_cq_dry_message(self):
65 self.assertTrue(utils.is_cq_dry_message('Dry run: Try jobs failed...'))
66 self.assertFalse(utils.is_cq_dry_message(
67 'Try jobs failed because builder name is Dry Run...'))
68
51 69
52 if __name__ == '__main__': 70 if __name__ == '__main__':
53 unittest.main() 71 unittest.main()
OLDNEW
« no previous file with comments | « appengine/chromium_rietveld/codereview/views.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698