forked from sr2/cloud-api
feat: all unique constraints tested
This commit is contained in:
parent
52990aae13
commit
e9b272811f
7 changed files with 28 additions and 11 deletions
|
|
@ -549,6 +549,10 @@ async def test_post_perm_success(default_client: AsyncClient, db_session):
|
|||
@pytest.mark.parametrize(
|
||||
"body, expected_status",
|
||||
[
|
||||
(
|
||||
{"service_id": 1, "resource": "test_resource", "action": "read"},
|
||||
409,
|
||||
),
|
||||
# service_id tests
|
||||
(
|
||||
{"service_id": 42, "resource": "test_resource", "action": "read"},
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ async def test_post_org_success(default_client: AsyncClient):
|
|||
@pytest.mark.parametrize(
|
||||
"body, expected_status",
|
||||
[
|
||||
({"name": "Test Org"}, 409),
|
||||
({"name": 42}, 422),
|
||||
({}, 422),
|
||||
({"name": "New Test Org", "intake_questionnaire": {"question_one": 42}}, 422),
|
||||
|
|
|
|||
|
|
@ -46,12 +46,13 @@ async def test_post_service_success(default_client: AsyncClient):
|
|||
@pytest.mark.parametrize(
|
||||
"body, expected_status",
|
||||
[
|
||||
({"name": "Test Service"}, 409),
|
||||
({"name": 42}, 422),
|
||||
({}, 422),
|
||||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_post_services_status_checks(
|
||||
async def test_post_service_status_checks(
|
||||
default_client: AsyncClient, body: dict[str, str], expected_status: int
|
||||
):
|
||||
resp = await default_client.post("/service/", json=body)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue