refactor tests

This commit is contained in:
ivankirpichnikov
2025-11-21 13:11:48 +03:00
parent fb6c415f1e
commit 2319b471a0
10 changed files with 227 additions and 138 deletions
+28
View File
@@ -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"