Beispiel #1
0
def test_step_zero(mocked_user_input):
    '''
    Verify that get_step_value does not fail if user entered zero step
    '''
    mocked_user_input.side_effect = [0, _EXPECTED_STEP]
    assert cli_helpers.get_step_value() == _EXPECTED_STEP
Beispiel #2
0
def test_not_integer(mocked_user_input):
    '''
    Verify that get_step_value does not fail if user's input is not an integer
    '''
    mocked_user_input.side_effect = ['not an integer', _EXPECTED_STEP]
    assert cli_helpers.get_step_value() == _EXPECTED_STEP
Beispiel #3
0
def test_step_negative(mocked_user_input):
    '''
    Verify that get_step_value does not fail if user entered a negative value
    '''
    mocked_user_input.side_effect = [-1, _EXPECTED_STEP]
    assert cli_helpers.get_step_value() == _EXPECTED_STEP
Beispiel #4
0
def test_step_empty(mocked_user_input):
    '''
    Verify that get_step_value does not fail if user didn't enter anything
    '''
    mocked_user_input.side_effect = [None, _EXPECTED_STEP]
    assert cli_helpers.get_step_value() == _EXPECTED_STEP