Exemplo n.º 1
0
def test_prompt_yes_no_invalid_default():
    prompt_yes_no('Shall I go ahead?', default='bla')
Exemplo n.º 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()
Exemplo n.º 3
0
def test_prompt_yes_no_reply_yes(mock_raw_input):
    assert prompt_yes_no('Shall I go ahead?')
Exemplo n.º 4
0
def test_prompt_yes_no_reply_no(mock_raw_input):
    assert not prompt_yes_no('Shall I go ahead?', default='y')
Exemplo n.º 5
0
def test_prompt_yes_no_default_yes(mock_raw_input):
    assert prompt_yes_no('Shall I go ahead?', default='y')