[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
abarth at webkit.org
abarth at webkit.org
Thu Dec 3 13:42:04 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 555c84f983f5f7e503f92ebc4a767ebb509a9a27
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Nov 21 04:06:06 2009 +0000
2009-11-20 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
Unit test query commands
https://bugs.webkit.org/show_bug.cgi?id=31755
These tests are pretty rough, but hopefully they'll grow.
* Scripts/modules/commands/queries_unittest.py: Added.
* Scripts/modules/mock_bugzillatool.py: Added.
* Scripts/run-webkit-unittests:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2efb2b9..609b886 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-20 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Unit test query commands
+ https://bugs.webkit.org/show_bug.cgi?id=31755
+
+ These tests are pretty rough, but hopefully they'll grow.
+
+ * Scripts/modules/commands/queries_unittest.py: Added.
+ * Scripts/modules/mock_bugzillatool.py: Added.
+ * Scripts/run-webkit-unittests:
+
2009-11-20 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
diff --git a/WebKitTools/Scripts/modules/commands/queries_unittest.py b/WebKitTools/Scripts/modules/commands/queries_unittest.py
new file mode 100644
index 0000000..5e8ddc1
--- /dev/null
+++ b/WebKitTools/Scripts/modules/commands/queries_unittest.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from modules.commands.queries import *
+from modules.mock_bugzillatool import *
+
+class QueryCommandsTest(unittest.TestCase):
+ def test_bugs_to_commit(self):
+ BugsToCommit().execute(None, None, MockBugzillaTool())
+
+ def test_patches_to_commit(self):
+ PatchesToCommit().execute(None, None, MockBugzillaTool())
+
+ def test_reviewed_patches(self):
+ args = [42]
+ ReviewedPatches().execute(None, args, MockBugzillaTool())
+
+ def test_tree_status(self):
+ TreeStatus().execute(None, None, MockBugzillaTool())
diff --git a/WebKitTools/Scripts/modules/mock_bugzillatool.py b/WebKitTools/Scripts/modules/mock_bugzillatool.py
new file mode 100644
index 0000000..d00538c
--- /dev/null
+++ b/WebKitTools/Scripts/modules/mock_bugzillatool.py
@@ -0,0 +1,58 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+class MockBugzilla():
+ patch1 = { "id": 197, "bug_id": 42, "url": "http://example.com/197" }
+ patch2 = { "id": 128, "bug_id": 42, "url": "http://example.com/128" }
+
+ def fetch_bug_ids_from_commit_queue(self):
+ return [42, 75]
+
+ def fetch_patches_from_commit_queue(self):
+ return [self.patch1, self.patch2]
+
+ def fetch_reviewed_patches_from_bug(self, bug_id):
+ if bug_id == 42:
+ return [self.patch1, self.patch2]
+ return None
+
+
+class MockBuildBot():
+ def builder_statuses(self):
+ return [{
+ "name": "Builder1",
+ "is_green": True
+ }, {
+ "name": "Builder2",
+ "is_green": True
+ }]
+
+
+class MockBugzillaTool():
+ bugs = MockBugzilla()
+ buildbot = MockBuildBot()
diff --git a/WebKitTools/Scripts/run-webkit-unittests b/WebKitTools/Scripts/run-webkit-unittests
index 7c54944..933bbdc 100755
--- a/WebKitTools/Scripts/run-webkit-unittests
+++ b/WebKitTools/Scripts/run-webkit-unittests
@@ -32,6 +32,7 @@ import unittest
from modules.bugzilla_unittest import *
from modules.buildbot_unittest import *
from modules.changelogs_unittest import *
+from modules.commands.queries_unittest import *
from modules.committers_unittest import *
from modules.cpp_style_unittest import *
from modules.diff_parser_unittest import *
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list