bebraw
1/21/2010 - 5:52 PM

test_application.py

...

@patch('__builtin__.raw_input')
def test_input_prefix(input_mock):
    # Note that prefix has to be tested separately as scenario tester
    # operates only on pure input. It just happens to use the same syntax
    # for input.
    keyboard_input = KeyboardInput()

    keyboard_input.get_data()

    input_mock.assert_called_with('>>> ')

...