Files
RekomenciBackend/tests/web_api/helpers.py
T
ivankirpichnikov 2319b471a0 refactor tests
2025-11-21 13:11:48 +03:00

29 lines
717 B
Python

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"