You've already forked RekomenciBackend
refactor tests
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from http import HTTPStatus
|
||||
from uuid import uuid4
|
||||
|
||||
from httpx import Response
|
||||
|
||||
|
||||
def is_success_response(response: Response) -> bool:
|
||||
return response.status_code == HTTPStatus.OK
|
||||
|
||||
|
||||
def is_unauthorized_response(response: Response) -> bool:
|
||||
return response.status_code == HTTPStatus.UNAUTHORIZED
|
||||
|
||||
|
||||
def is_not_found_response(response: Response) -> bool:
|
||||
return response.status_code == HTTPStatus.NOT_FOUND
|
||||
|
||||
|
||||
def is_forbidden_response(response: Response) -> bool:
|
||||
return response.status_code == HTTPStatus.FORBIDDEN
|
||||
|
||||
|
||||
def is_conflict_response(response: Response) -> bool:
|
||||
return response.status_code == HTTPStatus.CONFLICT
|
||||
|
||||
|
||||
def get_unique_email() -> str:
|
||||
return f"user-{uuid4().hex}@example.com"
|
||||
Reference in New Issue
Block a user