Exemplo n.º 1
0
def test_validate_empty_user_name():
    input = ""
    with pytest.raises(UserInputError) as info:
        validate_user_name(input)
    assert 'user input error' in str(info.value)
Exemplo n.º 2
0
def test_validate_correct_input():
    input = "apple345"
    assert validate_user_name(input) == True
Exemplo n.º 3
0
def test_validate_incorrect_length():
    input = "really_a_very_longpassword"
    with pytest.raises(UserInputError) as info:
        validate_user_name(input)
    assert 'user input error' in str(info.value)
Exemplo n.º 4
0
def test_validate_incorrect_length():
    input = "aaaaaaaaaaaaaaaaaaaaaaaaaa"
    with pytest.raises(UserInputError) as info:
        validate_user_name(input)
    assert 'user input error' in str(info.value)
Exemplo n.º 5
0
def test_validate_empty_user_name():
    input = ""
    with pytest.raises(UserInputError) as ex:
        validate_user_name(input)
    assert 'invalid username' in str(ex.value)
Exemplo n.º 6
0
def test_validate_incorrect_length():
    input = "somereallyreallylongusername"
    with pytest.raises(UserInputError) as ex:
        validate_user_name(input)
    assert 'invalid username' in str(ex.value)