| OLD | NEW |
| 1 # Copyright (C) 2009 Google Inc. All rights reserved. | 1 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import optparse | 29 import optparse |
| 30 import unittest | 30 import unittest |
| 31 | 31 |
| 32 from webkitpy.common.system.outputcapture import OutputCapture | 32 from webkitpy.common.system.output_capture import OutputCapture |
| 33 from webkitpy.tool.mock_tool import MockWebKitPatch | 33 from webkitpy.tool.mock_tool import MockWebKitPatch |
| 34 | 34 |
| 35 | 35 |
| 36 class CommandsTest(unittest.TestCase): | 36 class CommandsTest(unittest.TestCase): |
| 37 | 37 |
| 38 def assert_execute_outputs( | 38 def assert_execute_outputs( |
| 39 self, command, args=None, expected_stdout="", expected_stderr="", | 39 self, command, args=None, expected_stdout="", expected_stderr="", |
| 40 expected_exception=None, expected_logs=None, options=optparse.Values
(), tool=MockWebKitPatch()): | 40 expected_exception=None, expected_logs=None, options=optparse.Values
(), tool=MockWebKitPatch()): |
| 41 args = args or [] | 41 args = args or [] |
| 42 options.blocks = None | 42 options.blocks = None |
| 43 options.cc = 'MOCK cc' | 43 options.cc = 'MOCK cc' |
| 44 options.component = 'MOCK component' | 44 options.component = 'MOCK component' |
| 45 options.confirm = True | 45 options.confirm = True |
| 46 options.email = 'MOCK email' | 46 options.email = 'MOCK email' |
| 47 options.git_commit = 'MOCK git commit' | 47 options.git_commit = 'MOCK git commit' |
| 48 options.obsolete_patches = True | 48 options.obsolete_patches = True |
| 49 options.open_bug = True | 49 options.open_bug = True |
| 50 options.port = 'MOCK port' | 50 options.port = 'MOCK port' |
| 51 options.update_changelogs = False | 51 options.update_changelogs = False |
| 52 options.quiet = True | 52 options.quiet = True |
| 53 options.reviewer = 'MOCK reviewer' | 53 options.reviewer = 'MOCK reviewer' |
| 54 OutputCapture().assert_outputs( | 54 OutputCapture().assert_outputs( |
| 55 self, command.execute, [options, args, tool], expected_stdout=expect
ed_stdout, | 55 self, command.execute, [options, args, tool], expected_stdout=expect
ed_stdout, |
| 56 expected_stderr=expected_stderr, expected_exception=expected_excepti
on, expected_logs=expected_logs) | 56 expected_stderr=expected_stderr, expected_exception=expected_excepti
on, expected_logs=expected_logs) |
| OLD | NEW |