[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Wed Apr 7 23:57:37 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e637dc1caabcf9616611df39b246b4d4b4ff2433
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 26 03:02:48 2009 +0000

    2009-11-25  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Add unit test for mark-fixed
            https://bugs.webkit.org/show_bug.cgi?id=31896
    
            * Scripts/modules/commands/commandtest.py: Added.
            * Scripts/modules/commands/queries_unittest.py:
            * Scripts/modules/commands/upload_unittest.py: Added.
            * Scripts/modules/mock_bugzillatool.py:
            * Scripts/run-webkit-unittests:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ec342c0..0a77a7b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,19 @@
 
         Reviewed by Eric Seidel.
 
+        Add unit test for mark-fixed
+        https://bugs.webkit.org/show_bug.cgi?id=31896
+
+        * Scripts/modules/commands/commandtest.py: Added.
+        * Scripts/modules/commands/queries_unittest.py:
+        * Scripts/modules/commands/upload_unittest.py: Added.
+        * Scripts/modules/mock_bugzillatool.py:
+        * Scripts/run-webkit-unittests:
+
+2009-11-25  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         bugzilla-tool should have a mark-fixed command
         https://bugs.webkit.org/show_bug.cgi?id=31853
 
diff --git a/WebKitTools/Scripts/modules/commands/commandtest.py b/WebKitTools/Scripts/modules/commands/commandtest.py
new file mode 100644
index 0000000..5532b26
--- /dev/null
+++ b/WebKitTools/Scripts/modules/commands/commandtest.py
@@ -0,0 +1,41 @@
+# 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.mock_bugzillatool import MockBugzillaTool
+from modules.outputcapture import OutputCapture
+
+class CommandsTest(unittest.TestCase):
+    def assert_execute_outputs(self, command, command_args, expected_stdout, expected_stderr=""):
+        capture = OutputCapture()
+        capture.capture_output()
+        command.execute(None, command_args, MockBugzillaTool())
+        (stdout_string, stderr_string) = capture.restore_output()
+        self.assertEqual(stdout_string, expected_stdout)
+        self.assertEqual(expected_stderr, expected_stderr)
diff --git a/WebKitTools/Scripts/modules/commands/queries_unittest.py b/WebKitTools/Scripts/modules/commands/queries_unittest.py
index d081c52..90f565a 100644
--- a/WebKitTools/Scripts/modules/commands/queries_unittest.py
+++ b/WebKitTools/Scripts/modules/commands/queries_unittest.py
@@ -28,31 +28,22 @@
 
 import unittest
 
+from modules.commands.commandtest import CommandsTest
 from modules.commands.queries import *
-from modules.mock_bugzillatool import *
-from modules.outputcapture import OutputCapture
-
-class QueryCommandsTest(unittest.TestCase):
-    def _assert_execute_outputs(self, command, command_args, expected_stdout, expected_stderr = ""):
-        capture = OutputCapture()
-        capture.capture_output()
-        command.execute(None, command_args, MockBugzillaTool())
-        (stdout_string, stderr_string) = capture.restore_output()
-        self.assertEqual(stdout_string, expected_stdout)
-        self.assertEqual(expected_stderr, expected_stderr)
 
+class QueryCommandsTest(CommandsTest):
     def test_bugs_to_commit(self):
-        self._assert_execute_outputs(BugsToCommit(), None, "42\n75\n")
+        self.assert_execute_outputs(BugsToCommit(), None, "42\n75\n")
 
     def test_patches_to_commit(self):
         expected_stdout = "http://example.com/197\nhttp://example.com/128\n"
         expected_stderr = "Patches in commit queue:\n"
-        self._assert_execute_outputs(PatchesToCommit(), None, expected_stdout, expected_stderr)
+        self.assert_execute_outputs(PatchesToCommit(), None, expected_stdout, expected_stderr)
 
     def test_reviewed_patches(self):
         expected_stdout = "http://example.com/197\nhttp://example.com/128\n"
-        self._assert_execute_outputs(ReviewedPatches(), [42], expected_stdout)
+        self.assert_execute_outputs(ReviewedPatches(), [42], expected_stdout)
 
     def test_tree_status(self):
         expected_stdout = "ok   : Builder1\nok   : Builder2\n"
-        self._assert_execute_outputs(TreeStatus(), None, expected_stdout)
+        self.assert_execute_outputs(TreeStatus(), None, expected_stdout)
diff --git a/WebKitTools/Scripts/modules/commands/upload_unittest.py b/WebKitTools/Scripts/modules/commands/upload_unittest.py
new file mode 100644
index 0000000..093ebe3
--- /dev/null
+++ b/WebKitTools/Scripts/modules/commands/upload_unittest.py
@@ -0,0 +1,36 @@
+# 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.commandtest import CommandsTest
+from modules.commands.upload import *
+
+class UploadCommandsTest(CommandsTest):
+    def test_mark_fixed(self):
+        self.assert_execute_outputs(MarkFixed(), [43, "Test comment"], "", "")
diff --git a/WebKitTools/Scripts/modules/mock_bugzillatool.py b/WebKitTools/Scripts/modules/mock_bugzillatool.py
index d00538c..4399763 100644
--- a/WebKitTools/Scripts/modules/mock_bugzillatool.py
+++ b/WebKitTools/Scripts/modules/mock_bugzillatool.py
@@ -41,6 +41,9 @@ class MockBugzilla():
             return [self.patch1, self.patch2]
         return None
 
+    def close_bug_as_fixed(self, bug_id, comment_text=None):
+        pass
+
 
 class MockBuildBot():
     def builder_statuses(self):
diff --git a/WebKitTools/Scripts/run-webkit-unittests b/WebKitTools/Scripts/run-webkit-unittests
index 933bbdc..f447dfa 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.upload_unittest import *
 from modules.commands.queries_unittest import *
 from modules.committers_unittest import *
 from modules.cpp_style_unittest import *

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list