summaryrefslogtreecommitdiff
path: root/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-27 09:28:46 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-27 09:28:46 +0200
commit6668b07fcd51f86be243b9e08e667224e30c0cf8 (patch)
tree64f466e09b68a77ae1156c0d35cd5b95e18a34ca /Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
parente7923d9de38974f0c6fb7646c898a6ea618261e8 (diff)
downloadqtwebkit-6668b07fcd51f86be243b9e08e667224e30c0cf8.tar.gz
Imported WebKit commit 26cd9bd8ab0471ffe987c9b60368f63dc0f1f31b (http://svn.webkit.org/repository/webkit/trunk@121325)
New snapshot with more Windows build fixes
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"