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)
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)