Skip to content

Commit

Permalink
Add test for endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensWe committed Dec 9, 2024
1 parent b4ef61b commit dc98894
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion amt/locale/base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-12-09 10:18+0100\n"
"POT-Creation-Date: 2024-12-09 10:21+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
Binary file modified amt/locale/en_US/LC_MESSAGES/messages.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion amt/locale/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-12-09 10:18+0100\n"
"POT-Creation-Date: 2024-12-09 10:21+0100\n"
"PO-Revision-Date: 0001-01-01 00:00+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
Expand Down
Binary file modified amt/locale/nl_NL/LC_MESSAGES/messages.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion amt/locale/nl_NL/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-12-09 10:18+0100\n"
"POT-Creation-Date: 2024-12-09 10:21+0100\n"
"PO-Revision-Date: 0001-01-01 00:00+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: nl_NL\n"
Expand Down
17 changes: 17 additions & 0 deletions tests/api/routes/test_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,3 +575,20 @@ async def test_update_measure_value(client: AsyncClient, mocker: MockFixture, db
)
assert response.status_code == 200
assert response.headers["content-type"] == "text/html; charset=utf-8"


@pytest.mark.asyncio
async def test_download_algorithm_system_card_as_yaml(
client: AsyncClient, mocker: MockFixture, db: DatabaseTestUtils
) -> None:
# given
await db.given([default_user(), default_algorithm_with_system_card("testalgorithm1")])
client.cookies["fastapi-csrf-token"] = "1"
mocker.patch("fastapi_csrf_protect.CsrfProtect.validate_csrf", new_callable=mocker.AsyncMock)

# happy flow
response = await client.get("/algorithm/1/details/system_card/download")

assert response.status_code == 200
assert response.headers["content-type"] == "text/plain; charset=utf-8"
assert b"ai_act_profile:" in response.content

0 comments on commit dc98894

Please sign in to comment.