| 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)
|
|
|