Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1240)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py

Issue 2385373003: Fix webkit-patch --help. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py
index 67025774f596d85d0fcf8ff2f0cc35b45e950cc8..b6c8db9efee4fb80a54eed7ac2348a95f784cc1a 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py
@@ -30,7 +30,7 @@ class WebKitPatchTest(unittest.TestCase):
self.assertEqual(tool.command_by_name('help').name, 'help')
self.assertIsNone(tool.command_by_name('non-existent'))
- def test_help(self):
+ def test_help_command(self):
oc = OutputCapture()
oc.capture_output()
tool = WebKitPatch('path')
@@ -39,3 +39,17 @@ class WebKitPatchTest(unittest.TestCase):
self.assertTrue(out.startswith('Usage: '))
self.assertEqual('', err)
self.assertEqual('', logs)
+
+ def test_help_argument(self):
+ oc = OutputCapture()
+ oc.capture_output()
+ tool = WebKitPatch('path')
+ try:
+ tool.main(['tool', '--help'])
+ except SystemExit:
+ pass # optparse calls sys.exit after showing help.
+ finally:
+ out, err, logs = oc.restore_output()
+ self.assertTrue(out.startswith('Usage: '))
+ self.assertEqual('', err)
+ self.assertEqual('', logs)
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698