OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
7 from webkitpy.common.system.outputcapture import OutputCapture | 7 from webkitpy.common.system.output_capture import OutputCapture |
8 from webkitpy.tool.webkit_patch import WebKitPatch | 8 from webkitpy.tool.webkit_patch import WebKitPatch |
9 | 9 |
10 | 10 |
11 class WebKitPatchTest(unittest.TestCase): | 11 class WebKitPatchTest(unittest.TestCase): |
12 | 12 |
13 def test_split_args_basic(self): | 13 def test_split_args_basic(self): |
14 self.assertEqual( | 14 self.assertEqual( |
15 WebKitPatch._split_command_name_from_args(['--global-option', 'comma
nd', '--option', 'arg']), | 15 WebKitPatch._split_command_name_from_args(['--global-option', 'comma
nd', '--option', 'arg']), |
16 ('command', ['--global-option', '--option', 'arg'])) | 16 ('command', ['--global-option', '--option', 'arg'])) |
17 | 17 |
(...skipping 28 matching lines...) Expand all Loading... |
46 tool = WebKitPatch('path') | 46 tool = WebKitPatch('path') |
47 try: | 47 try: |
48 tool.main(['tool', '--help']) | 48 tool.main(['tool', '--help']) |
49 except SystemExit: | 49 except SystemExit: |
50 pass # optparse calls sys.exit after showing help. | 50 pass # optparse calls sys.exit after showing help. |
51 finally: | 51 finally: |
52 out, err, logs = oc.restore_output() | 52 out, err, logs = oc.restore_output() |
53 self.assertTrue(out.startswith('Usage: ')) | 53 self.assertTrue(out.startswith('Usage: ')) |
54 self.assertEqual('', err) | 54 self.assertEqual('', err) |
55 self.assertEqual('', logs) | 55 self.assertEqual('', logs) |
OLD | NEW |