def test_authentication_with_valid_credentials(in_memory_repo): new_username = '******' new_password = '******' auth_services.add_user(new_username, new_password, in_memory_repo) try: auth_services.authenticate_user(new_username, new_password, in_memory_repo) except AuthenticationException: assert False
def test_cannot_add_user_with_existing_name(in_memory_repo): auth_services.add_user("djoh991", "paper450", in_memory_repo) with pytest.raises(auth_services.NameNotUniqueException): auth_services.add_user('djoh991', "abcd1A23", in_memory_repo)