Error handling in following functions
This commit is contained in:
@@ -40,9 +40,8 @@ def test_get_user(db_session):
|
||||
assert retrieved_user.name == "testuser"
|
||||
|
||||
# Try to get non-existent user
|
||||
with pytest.raises(HTTPException) as exc_info:
|
||||
get_user(db_session, "nonexistent")
|
||||
assert exc_info.value.status_code == status.HTTP_404_NOT_FOUND
|
||||
retrieved_user = get_user(db_session, "nonexistent")
|
||||
assert retrieved_user is None
|
||||
|
||||
|
||||
def test_authenticate_user(db_session):
|
||||
|
||||
Reference in New Issue
Block a user