Example #1
0
def test_prompt_yes_no_invalid_default():
    prompt_yes_no('Shall I go ahead?', default='bla')
Example #2
0
def test_prompt_yes_no_reply_invalid(mock_raw_input):
    with mock.patch('sys.stdout', new_callable=StringIO) as mock_stdout:
        assert not prompt_yes_no('Shall I go ahead?')
    assert 'An invalid choice was entered' in mock_stdout.getvalue()
Example #3
0
def test_prompt_yes_no_reply_yes(mock_raw_input):
    assert prompt_yes_no('Shall I go ahead?')
Example #4
0
def test_prompt_yes_no_reply_no(mock_raw_input):
    assert not prompt_yes_no('Shall I go ahead?', default='y')
Example #5
0
def test_prompt_yes_no_default_yes(mock_raw_input):
    assert prompt_yes_no('Shall I go ahead?', default='y')