summaryrefslogtreecommitdiff
path: root/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/commands/queries_unittest.py')
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries_unittest.py57
1 files changed, 54 insertions, 3 deletions
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index a86154b78..09b45ba55 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -1,4 +1,5 @@
# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -84,9 +85,59 @@ class QueryCommandsTest(CommandsTest):
self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
def test_patches_to_review(self):
- expected_stdout = "10002\n"
- expected_stderr = "Patches pending review:\n"
- self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr)
+ options = Mock()
+
+ # When no cc_email is provided, we use the Bugzilla username by default.
+ # The MockBugzilla will fake the authentication using username@webkit.org
+ # as login and it should match the username at the report header.
+ options.cc_email = None
+ options.include_cq_denied = False
+ options.all = False
+ expected_stdout = \
+ "Bugs with attachments pending review that has username@webkit.org in the CC list:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "Total: 0\n"
+ expected_stderr = ""
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = "abarth@webkit.org"
+ options.include_cq_denied = True
+ options.all = False
+ expected_stdout = \
+ "Bugs with attachments pending review that has abarth@webkit.org in the CC list:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "http://webkit.org/b/50001 Bug with a patch needing review. (0)\n" \
+ "Total: 1\n"
+ expected_stderr = ""
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = None
+ options.include_cq_denied = True
+ options.all = True
+ expected_stdout = \
+ "Bugs with attachments pending review:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "http://webkit.org/b/50001 Bug with a patch needing review. (0)\n" \
+ "Total: 1\n"
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = None
+ options.include_cq_denied = False
+ options.all = True
+ expected_stdout = \
+ "Bugs with attachments pending review:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "Total: 0\n"
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = "invalid_email@example.com"
+ options.all = False
+ options.include_cq_denied = True
+ expected_stdout = \
+ "Bugs with attachments pending review that has invalid_email@example.com in the CC list:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "Total: 0\n"
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
def test_tree_status(self):
expected_stdout = "ok : Builder1\nok : Builder2\n"