Exemple #1
0
def test_auth_badpassword():
    with pytest.raises(pampylho.PAMError) as exc_info:
        pampylho.authenticate(getpass.getuser(), 'wrongpassword')

    e = exc_info.value
    assert 'Unknown' not in str(e)
Exemple #2
0
def test_auth_nouser():
    with pytest.raises(pampylho.PAMError) as exc_info:
        pampylho.authenticate('userdoesntexist', 'wrongpassword')
    
    e = exc_info.value
    assert 'Unknown' not in str(e)