refactor: global codebase refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# AdNova Tests
|
||||
|
||||
There is `unit` tests and `e2e` tests available, unit tests are placed all around `backend` serivce folder and `e2e` tests placed [here](./e2e/)
|
||||
There is `unit` and `e2e` tests available, unit tests are placed all around `backend` serivce folder and `e2e` tests placed [here](./e2e/)
|
||||
|
||||
## Running unit tests
|
||||
|
||||
@@ -12,7 +12,7 @@ See [services/backend/README.md](../services/backend/README.md#testing)
|
||||
|
||||
### Backend service
|
||||
|
||||
-image-
|
||||

|
||||
|
||||
## Running e2e tests
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ cd devitq/solution/tests/e2e
|
||||
uv sync --no-dev
|
||||
```
|
||||
|
||||
## Customize environment
|
||||
## Customize environment (optional)
|
||||
|
||||
```bash
|
||||
cp .env.template .env
|
||||
|
||||
@@ -107,4 +107,3 @@ unfixable = []
|
||||
|
||||
[tool.ruff.lint.pylint]
|
||||
max-args = 6
|
||||
|
||||
|
||||
@@ -8,8 +8,15 @@ logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Tests integration between: backend, redis, yandexgpt and celery
|
||||
def test_generate_ad_text(client: Client) -> None:
|
||||
"""
|
||||
Tests integration between:
|
||||
- backend
|
||||
- redis
|
||||
- yandexgpt
|
||||
- celery
|
||||
"""
|
||||
|
||||
payload = {
|
||||
"advertiser_name": "Центральный Университет",
|
||||
"ad_title": "Всероссийский кейс-чемпионат DEADLINE",
|
||||
@@ -25,10 +32,7 @@ def test_generate_ad_text(client: Client) -> None:
|
||||
|
||||
while True:
|
||||
result_response = client.get(f"/generate/ad_text/{task_id}/result")
|
||||
assert (
|
||||
result_response.status_code == status.OK
|
||||
or result_response.status_code == status.NOT_FOUND
|
||||
)
|
||||
assert result_response.status_code in (status.OK, status.NOT_FOUND)
|
||||
result_data = result_response.json()
|
||||
|
||||
if (
|
||||
|
||||
@@ -9,7 +9,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
def test_healthcheck(client: Client) -> None:
|
||||
"""
|
||||
Checks that backend can use theese services:
|
||||
Tests integration between:
|
||||
- redis
|
||||
- celery
|
||||
- postgres
|
||||
|
||||
Reference in New Issue
Block a user