Bug 1275774 - Add tests for new taskcluster try flag parsing draft
authorBrian Stack <bstack@mozilla.com>
Wed, 28 Sep 2016 09:34:42 -0700
changeset 418517 be80dd1454981fe3a15c6f7be80142273ee5c0bd
parent 418516 1add188f671b252a731d13114f93d2910130f4f4
child 532362 9937c588de564cb50d2b1a16eade17fc85466d6e
push id30698
push userbstack@mozilla.com
push dateWed, 28 Sep 2016 16:35:50 +0000
bugs1275774
milestone52.0a1
Bug 1275774 - Add tests for new taskcluster try flag parsing MozReview-Commit-ID: 1QKnLZE0hzU
taskcluster/taskgraph/test/test_try_option_syntax.py
--- a/taskcluster/taskgraph/test/test_try_option_syntax.py
+++ b/taskcluster/taskgraph/test/test_try_option_syntax.py
@@ -250,10 +250,25 @@ class TestTryOptionSyntax(unittest.TestC
         tos = TryOptionSyntax('try: --rebuild 10', empty_graph)
         self.assertEqual(tos.trigger_tests, 10)
 
     def test_interactive(self):
         "--interactive sets interactive"
         tos = TryOptionSyntax('try: --interactive', empty_graph)
         self.assertEqual(tos.interactive, True)
 
+    def test_all_email(self):
+        "--all-emails sets notifications"
+        tos = TryOptionSyntax('try: --all-emails', empty_graph)
+        self.assertEqual(tos.notifications, 'all')
+
+    def test_fail_email(self):
+        "--failure-emails sets notifications"
+        tos = TryOptionSyntax('try: --failure-emails', empty_graph)
+        self.assertEqual(tos.notifications, 'failure')
+
+    def test_no_email(self):
+        "no email settings don't set notifications"
+        tos = TryOptionSyntax('try:', empty_graph)
+        self.assertEqual(tos.notifications, None)
+
 if __name__ == '__main__':
     main()