| OLD | NEW |
| 1 # Copyright (C) 2010 Research in Motion Ltd. All rights reserved. | 1 # Copyright (C) 2010 Research in Motion Ltd. 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 10 matching lines...) Expand all Loading... |
| 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 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 unittest | 29 import unittest |
| 30 | 30 |
| 31 from webkitpy.common.system.outputcapture import OutputCapture | 31 from webkitpy.common.system.output_capture import OutputCapture |
| 32 from webkitpy.common.system.user import User | 32 from webkitpy.common.system.user import User |
| 33 | 33 |
| 34 | 34 |
| 35 class UserTest(unittest.TestCase): | 35 class UserTest(unittest.TestCase): |
| 36 | 36 |
| 37 example_user_response = "example user response" | 37 example_user_response = "example user response" |
| 38 | 38 |
| 39 def test_prompt_repeat(self): | 39 def test_prompt_repeat(self): |
| 40 self.repeatsRemaining = 2 | 40 self.repeatsRemaining = 2 |
| 41 | 41 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 for test_case in test_cases: | 123 for test_case in test_cases: |
| 124 expected, inputs = test_case | 124 expected, inputs = test_case |
| 125 | 125 |
| 126 def mock_raw_input(message): | 126 def mock_raw_input(message): |
| 127 self.assertEqual(expected[0], message) | 127 self.assertEqual(expected[0], message) |
| 128 return inputs[1] | 128 return inputs[1] |
| 129 | 129 |
| 130 result = User().confirm(default=inputs[0], | 130 result = User().confirm(default=inputs[0], |
| 131 raw_input=mock_raw_input) | 131 raw_input=mock_raw_input) |
| 132 self.assertEqual(expected[1], result) | 132 self.assertEqual(expected[1], result) |
| OLD | NEW |