You've already forked RekomenciBackend
add skills endpoints
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
from dishka import FromDishka
|
||||
|
||||
from tests.web_api.helpers import is_success_response
|
||||
from tests.web_api.ioc import DatabaseClearer, inject
|
||||
from tests.web_api.test_api_gateway import TestApiGateway
|
||||
|
||||
|
||||
@inject
|
||||
async def test_add_key_skill(
|
||||
client: FromDishka[TestApiGateway],
|
||||
database_clearer: FromDishka[DatabaseClearer],
|
||||
) -> None:
|
||||
await database_clearer.clear()
|
||||
|
||||
response = await client.add_key_skill(key_skills=["Python", "Django", "REST APIs"])
|
||||
assert is_success_response(response)
|
||||
|
||||
|
||||
@inject
|
||||
async def test_search_key_skills(
|
||||
client: FromDishka[TestApiGateway],
|
||||
database_clearer: FromDishka[DatabaseClearer],
|
||||
) -> None:
|
||||
await database_clearer.clear()
|
||||
|
||||
await client.add_key_skill(key_skills=["Python", "Django", "Python3.12", "REST APIs"])
|
||||
response = await client.search_key_skills("p")
|
||||
assert is_success_response(response)
|
||||
assert {name["name"] for name in response.json()} == {"Python", "Python3.12"}
|
||||
Reference in New Issue
Block a user