Changeset 51278 in webkit
- Timestamp:
- Nov 20, 2009 8:06:06 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r51277 r51278 1 2009-11-20 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Unit test query commands 6 https://bugs.webkit.org/show_bug.cgi?id=31755 7 8 These tests are pretty rough, but hopefully they'll grow. 9 10 * Scripts/modules/commands/queries_unittest.py: Added. 11 * Scripts/modules/mock_bugzillatool.py: Added. 12 * Scripts/run-webkit-unittests: 13 1 14 2009-11-20 Eric Seidel <eric@webkit.org> 2 15 -
trunk/WebKitTools/Scripts/modules/commands/queries_unittest.py
- Property svn:executable deleted
r51277 r51278 1 #!/usr/bin/env python 2 # Copyright (c) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2009 Google Inc. All rights reserved. 3 2 # 4 3 # Redistribution and use in source and binary forms, with or without 5 4 # modification, are permitted provided that the following conditions are 6 5 # met: 7 # 8 # 6 # 7 # * Redistributions of source code must retain the above copyright 9 8 # notice, this list of conditions and the following disclaimer. 10 # 9 # * Redistributions in binary form must reproduce the above 11 10 # copyright notice, this list of conditions and the following disclaimer 12 11 # in the documentation and/or other materials provided with the 13 12 # distribution. 14 # 13 # * Neither the name of Google Inc. nor the names of its 15 14 # contributors may be used to endorse or promote products derived from 16 15 # this software without specific prior written permission. 17 # 16 # 18 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 30 29 import unittest 31 30 32 from modules.bugzilla_unittest import * 33 from modules.buildbot_unittest import * 34 from modules.changelogs_unittest import * 35 from modules.committers_unittest import * 36 from modules.cpp_style_unittest import * 37 from modules.diff_parser_unittest import * 38 from modules.logging_unittest import * 39 from modules.multicommandtool_unittest import * 40 from modules.patchcollection_unittest import * 41 from modules.scm_unittest import * 42 from modules.webkitport_unittest import * 43 from modules.workqueue_unittest import * 31 from modules.commands.queries import * 32 from modules.mock_bugzillatool import * 44 33 45 if __name__ == "__main__": 46 unittest.main() 34 class QueryCommandsTest(unittest.TestCase): 35 def test_bugs_to_commit(self): 36 BugsToCommit().execute(None, None, MockBugzillaTool()) 37 38 def test_patches_to_commit(self): 39 PatchesToCommit().execute(None, None, MockBugzillaTool()) 40 41 def test_reviewed_patches(self): 42 args = [42] 43 ReviewedPatches().execute(None, args, MockBugzillaTool()) 44 45 def test_tree_status(self): 46 TreeStatus().execute(None, None, MockBugzillaTool()) -
trunk/WebKitTools/Scripts/modules/mock_bugzillatool.py
- Property svn:executable deleted
r51277 r51278 1 #!/usr/bin/env python 2 # Copyright (c) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2009 Google Inc. All rights reserved. 3 2 # 4 3 # Redistribution and use in source and binary forms, with or without 5 4 # modification, are permitted provided that the following conditions are 6 5 # met: 7 # 8 # 6 # 7 # * Redistributions of source code must retain the above copyright 9 8 # notice, this list of conditions and the following disclaimer. 10 # 9 # * Redistributions in binary form must reproduce the above 11 10 # copyright notice, this list of conditions and the following disclaimer 12 11 # in the documentation and/or other materials provided with the 13 12 # distribution. 14 # 13 # * Neither the name of Google Inc. nor the names of its 15 14 # contributors may be used to endorse or promote products derived from 16 15 # this software without specific prior written permission. 17 # 16 # 18 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 28 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 28 30 import unittest 29 class MockBugzilla(): 30 patch1 = { "id": 197, "bug_id": 42, "url": "http://example.com/197" } 31 patch2 = { "id": 128, "bug_id": 42, "url": "http://example.com/128" } 31 32 32 from modules.bugzilla_unittest import * 33 from modules.buildbot_unittest import * 34 from modules.changelogs_unittest import * 35 from modules.committers_unittest import * 36 from modules.cpp_style_unittest import * 37 from modules.diff_parser_unittest import * 38 from modules.logging_unittest import * 39 from modules.multicommandtool_unittest import * 40 from modules.patchcollection_unittest import * 41 from modules.scm_unittest import * 42 from modules.webkitport_unittest import * 43 from modules.workqueue_unittest import * 33 def fetch_bug_ids_from_commit_queue(self): 34 return [42, 75] 44 35 45 if __name__ == "__main__": 46 unittest.main() 36 def fetch_patches_from_commit_queue(self): 37 return [self.patch1, self.patch2] 38 39 def fetch_reviewed_patches_from_bug(self, bug_id): 40 if bug_id == 42: 41 return [self.patch1, self.patch2] 42 return None 43 44 45 class MockBuildBot(): 46 def builder_statuses(self): 47 return [{ 48 "name": "Builder1", 49 "is_green": True 50 }, { 51 "name": "Builder2", 52 "is_green": True 53 }] 54 55 56 class MockBugzillaTool(): 57 bugs = MockBugzilla() 58 buildbot = MockBuildBot() -
trunk/WebKitTools/Scripts/run-webkit-unittests
r51231 r51278 33 33 from modules.buildbot_unittest import * 34 34 from modules.changelogs_unittest import * 35 from modules.commands.queries_unittest import * 35 36 from modules.committers_unittest import * 36 37 from modules.cpp_style_unittest import *
Note: See TracChangeset
for help on using the changeset viewer.