forked from sr2/cloud-api
fix: ty compliant & issues from change to mapped columns
This commit is contained in:
parent
55927946c7
commit
58e7ae6c5c
31 changed files with 271 additions and 254 deletions
|
|
@ -35,9 +35,7 @@ async def test_get_org_success(default_client: AsyncClient):
|
|||
assert org["security_contact"]["email"] == "security@orgone.com"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query, expected_status", generate_query_and_status(["org_id"])
|
||||
)
|
||||
@pytest.mark.parametrize("query, expected_status", generate_query_and_status(["org_id"]))
|
||||
@pytest.mark.anyio
|
||||
async def test_get_org_status_checks(
|
||||
default_client: AsyncClient, query: str, expected_status: int
|
||||
|
|
@ -60,7 +58,6 @@ async def test_post_org_success(default_client: AsyncClient):
|
|||
@pytest.mark.parametrize(
|
||||
"body, expected_status",
|
||||
[
|
||||
({"name": "Org One"}, 409),
|
||||
({"name": 42}, 422),
|
||||
({}, 422),
|
||||
({"name": "New Test Org", "intake_questionnaire": {"question_one": 42}}, 422),
|
||||
|
|
@ -229,9 +226,7 @@ async def test_get_org_users_success(default_client: AsyncClient):
|
|||
assert data["organisation"]["id"] == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query, expected_status", generate_query_and_status(["org_id"])
|
||||
)
|
||||
@pytest.mark.parametrize("query, expected_status", generate_query_and_status(["org_id"]))
|
||||
@pytest.mark.anyio
|
||||
async def test_get_org_users_status_checks(
|
||||
default_client: AsyncClient, query: str, expected_status: int
|
||||
|
|
@ -243,9 +238,7 @@ async def test_get_org_users_status_checks(
|
|||
|
||||
@pytest.mark.anyio
|
||||
async def test_post_org_user_success(default_client: AsyncClient):
|
||||
resp = await default_client.post(
|
||||
"/org/user", json={"organisation_id": 1, "user_id": 3}
|
||||
)
|
||||
resp = await default_client.post("/org/user", json={"organisation_id": 1, "user_id": 3})
|
||||
|
||||
assert resp.status_code == 200
|
||||
|
||||
|
|
@ -258,9 +251,7 @@ async def test_post_org_user_success(default_client: AsyncClient):
|
|||
|
||||
assert "users" in data
|
||||
assert isinstance(data["users"], list)
|
||||
assert (
|
||||
len([user for user in data["users"] if user["email"] == "root@orgtwo.com"]) == 1
|
||||
)
|
||||
assert len([user for user in data["users"] if user["email"] == "root@orgtwo.com"]) == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
@ -348,9 +339,7 @@ async def test_get_org_groups_success(default_client: AsyncClient):
|
|||
assert group["name"] == "Org One Group"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query, expected_status", generate_query_and_status(["org_id"])
|
||||
)
|
||||
@pytest.mark.parametrize("query, expected_status", generate_query_and_status(["org_id"]))
|
||||
@pytest.mark.anyio
|
||||
async def test_get_org_groups_status_checks(
|
||||
default_client: AsyncClient, query: str, expected_status: int
|
||||
|
|
@ -363,9 +352,7 @@ async def test_get_org_groups_status_checks(
|
|||
@pytest.mark.parametrize("contact_type", ["billing", "security", "owner"])
|
||||
@pytest.mark.anyio
|
||||
async def test_get_org_contact_success(default_client: AsyncClient, contact_type: str):
|
||||
resp = await default_client.get(
|
||||
f"/org/contact?org_id=1&contact_type={contact_type}"
|
||||
)
|
||||
resp = await default_client.get(f"/org/contact?org_id=1&contact_type={contact_type}")
|
||||
data = resp.json()
|
||||
|
||||
assert resp.status_code == 200
|
||||
|
|
@ -437,9 +424,7 @@ async def test_get_org_contact_status_checks(
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_patch_org_contact_success(
|
||||
default_client: AsyncClient, key: str, value: str
|
||||
):
|
||||
async def test_patch_org_contact_success(default_client: AsyncClient, key: str, value: str):
|
||||
resp = await default_client.patch(
|
||||
"/org/contact",
|
||||
json={"organisation_id": 1, "contact_type": "billing", key: value},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue