def mock_authenticate(username, password, service='login'): # just use equality for testing if password == username: return True else: raise PAMError("Fake")
def mock_check_account(username, service, encoding): if username.startswith('notallowed'): raise PAMError("Fake") else: return True