Exemple #1
0
def test_validate_user_email(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.email)
Exemple #2
0
def test_validate_user(test_input):
    validate_user(test_input)
Exemple #3
0
def test_validate_user_debian_invalid(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.debian)
    assert e.value.message == 'Username contains invalid characters.'
Exemple #4
0
def test_validate_user_principal(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.principal)
Exemple #5
0
def test_validate_user_disabled(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.disabled)
Exemple #6
0
def test_validate_user(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.useradd)
Exemple #7
0
def test_validate_user(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.useradd)
Exemple #8
0
def test_validate_user(test_input):
    validate_user(test_input)
Exemple #9
0
def test_validate_user_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts', USERNAME_VALIDATION_OPTIONS.useradd)
    assert str(e.value) == 'Username is too long.'
Exemple #10
0
def test_validate_user_contains_junk(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.useradd)
    assert str(e.value) == 'Username contains invalid characters.'
Exemple #11
0
def test_invalid_call_of_validate_user():
    with pytest.raises(ValidationError) as e:
        validate_user('test', None)
    assert str(e.value) == 'Invalid username validator.'
Exemple #12
0
def test_validate_user_disabled(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.disabled)
Exemple #13
0
def test_invalid_user_email(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.email)
    assert str(e.value) == 'Invalid email address.'
Exemple #14
0
def test_validate_user_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts')
    assert e.value.message == 'Username is too long.'
Exemple #15
0
def test_validate_user_debian_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts', USERNAME_VALIDATION_OPTIONS.debian)
    assert str(e.value) == 'Username is too long.'
Exemple #16
0
def test_validate_user_contains_junk(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input)
    assert e.value.message == 'Username contains invalid characters.'
Exemple #17
0
def test_validate_user_debian_invalid(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.debian)
    assert str(e.value) == 'Username contains invalid characters.'
Exemple #18
0
def test_invalid_user_email(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.email)
    assert e.value.message == 'Invalid email address.'
Exemple #19
0
def test_validate_user_blacklist(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.principal, 'root|admin.*|balrog|.+\'.*')
    assert str(e.value) == 'Username contains invalid characters.'
Exemple #20
0
def test_invalid_call_of_validate_user():
    with pytest.raises(ValidationError) as e:
        validate_user('test', None)
    assert e.value.message == 'Invalid username validator.'
Exemple #21
0
def test_validate_user_debian(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.debian)
Exemple #22
0
def test_validate_user_debian_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts',
                      USERNAME_VALIDATION_OPTIONS.debian)
    assert e.value.message == 'Username is too long.'
Exemple #23
0
def test_validate_user_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts')
    assert e.value.message == 'Username is too long.'
Exemple #24
0
def test_validate_user_debian(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.debian)
Exemple #25
0
def test_validate_user_contains_junk(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input)
    assert e.value.message == 'Username contains invalid characters.'
Exemple #26
0
def test_validate_user_email(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.email)
Exemple #27
0
def test_validate_user_principal(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.principal)