diff --git a/tests/integrations/auth_test.py b/tests/integrations/auth_test.py index 9c849c5..beea588 100644 --- a/tests/integrations/auth_test.py +++ b/tests/integrations/auth_test.py @@ -12,7 +12,7 @@ async def test_auth_token(client_db: AsyncClient): # noqa: F811; Якщо ні, то повернути помилку 401. """ user_json = {"email": "test", "password": "test"} # nosec B106 - await client_db.post("/users/create/", json=user_json) + await client_db.post("/users/", json=user_json) auth_json = {"username": user_json["email"], "password": user_json["password"]} auth_result = await client_db.post("/token/", data=auth_json) diff --git a/tests/integrations/bank_api_test.py b/tests/integrations/bank_api_test.py index 3645916..0e661d1 100644 --- a/tests/integrations/bank_api_test.py +++ b/tests/integrations/bank_api_test.py @@ -50,7 +50,7 @@ async def test_update_costs_with_endpoint(client_db: AsyncClient, database: Data # Створення менеджера uow = SqlAlchemyUnitOfWork(session) await create_monobank_manager(uow, user_id) - response = await client_db.put("/bankapi/update_costs/", headers=headers) + response = await client_db.put("/bankapi/costs/", headers=headers) assert response.status_code == 200 @@ -61,7 +61,7 @@ async def test_add_bank_info_with_endpoint(client_db: AsyncClient): headers = {"Authorization": token} response = await client_db.post( - "/bankapi/add/", + "/bankapi/", json={ "bank_name": "monobank", "X-Token": "uZFOvRJNeXoVHYTUA_8NgHneWUz8IsG8dRPUbx60mbM4", diff --git a/tests/integrations/categories_test.py b/tests/integrations/categories_test.py index 9386e03..a368c61 100644 --- a/tests/integrations/categories_test.py +++ b/tests/integrations/categories_test.py @@ -15,9 +15,7 @@ async def test_create_category_endpoint(client_db: AsyncClient): headers = {"Authorization": token} category_data = {"name": "category name"} - response = await client_db.post( - "/categories/create/", json=category_data, headers=headers - ) + response = await client_db.post("/categories/", json=category_data, headers=headers) assert response.status_code == 201 created_category = response.json() @@ -37,6 +35,6 @@ async def test_read_categories_endpoint(database: Database, client_db: AsyncClie schema = CategoryCreateSchema(name=f"test category #{i}") await create_category(uow, user_id, schema) - response = await client_db.get("/categories/list/", headers=headers) + response = await client_db.get("/categories/", headers=headers) assert response.status_code == 200 assert len(response.json()) == 10 diff --git a/tests/integrations/operations_test.py b/tests/integrations/operations_test.py index 79c46d7..a7773bf 100644 --- a/tests/integrations/operations_test.py +++ b/tests/integrations/operations_test.py @@ -22,7 +22,7 @@ async def test_create_operation_endpoint(client_db: AsyncClient): # noqa: F811; "source_type": "manual", } response = await client_db.post( - "/operations/create/", json=operation_data, headers=headers + "/operations/", json=operation_data, headers=headers ) assert response.status_code == 201 @@ -37,9 +37,7 @@ async def test_create_operation_with_incorrect_data(client_db: AsyncClient): token = auth_data["token"] headers = {"Authorization": token} - incorrect_response = await client_db.post( - "/operations/create/", json={}, headers=headers - ) + incorrect_response = await client_db.post("/operations/", json={}, headers=headers) assert incorrect_response.status_code == 422 @@ -55,11 +53,9 @@ async def test_read_operations_endpoint(client_db: AsyncClient): # noqa: F811; "description": "description", "source_type": "manual", } - await client_db.post( - "/operations/create/", json=operation_data, headers=headers - ) + await client_db.post("/operations/", json=operation_data, headers=headers) - operations_response = await client_db.get("/operations/list/", headers=headers) + operations_response = await client_db.get("/operations/", headers=headers) assert operations_response.status_code == 200 operations = operations_response.json() diff --git a/tests/integrations/users_test.py b/tests/integrations/users_test.py index dcbc874..ae7ad71 100644 --- a/tests/integrations/users_test.py +++ b/tests/integrations/users_test.py @@ -15,7 +15,7 @@ async def test_create_user_endpoint(client_db: AsyncClient): # noqa: F811; Testing src.views.users.create_user_view """ data = {"email": "test@mail.test", "password": "123456"} # nosec B106 - result = await client_db.post("/users/create/", json=data) + result = await client_db.post("/users/", json=data) assert result.status_code == 201 assert all(key in result.json() for key in ["id", "email"]) @@ -28,7 +28,7 @@ async def test_read_user(client_db: AsyncClient): # noqa: F811; auth_result = await create_and_auth_func_user(client_db) created_user, token = auth_result["user"], auth_result["token"] - read_result = await client_db.get("/users/me/", headers={"Authorization": token}) + read_result = await client_db.get("/users/", headers={"Authorization": token}) assert read_result.status_code == 200 user_data = read_result.json() diff --git a/tests/patterns.py b/tests/patterns.py index a641a1e..be74afa 100644 --- a/tests/patterns.py +++ b/tests/patterns.py @@ -33,7 +33,7 @@ async def create_func_user(client: AsyncClient) -> dict: :return: dict з інформацією про користувача """ user_data = {"email": "test@mail.test", "password": "123456"} # nosec B106 - return (await client.post("/users/create/", json=user_data)).json() + return (await client.post("/users/", json=user_data)).json() async def create_and_auth_func_user(client: AsyncClient) -> dict: @@ -64,4 +64,4 @@ async def create_operations(headers: dict, client: AsyncClient): "mcc": random.randint(1000, 9999), "source_type": "manual", } - await client.post("/operations/create/", json=operation_data, headers=headers) + await client.post("/operations/", json=operation_data, headers=headers)