From b4b19a545d40a17f272394b0b35777f832d6b0ee Mon Sep 17 00:00:00 2001 From: Laurens Weijs Date: Mon, 9 Dec 2024 10:15:27 +0100 Subject: [PATCH] Add test for endpoint --- amt/locale/base.pot | 2 +- amt/locale/en_US/LC_MESSAGES/messages.mo | Bin 989 -> 989 bytes amt/locale/en_US/LC_MESSAGES/messages.po | 2 +- amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 14051 -> 14051 bytes amt/locale/nl_NL/LC_MESSAGES/messages.po | 2 +- tests/api/routes/test_algorithm.py | 17 +++++++++++++++++ 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/amt/locale/base.pot b/amt/locale/base.pot index 0e8a820e..318c466d 100644 --- a/amt/locale/base.pot +++ b/amt/locale/base.pot @@ -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:35+0100\n" +"POT-Creation-Date: 2024-12-09 10:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index f14e1c9e07a2aa3a7aa859df2abafb4a06398473..cc5993b30056e4753bf44f6a6ea84377bc3ca0f6 100644 GIT binary patch delta 14 Vcmcc1ewTg2ZAM1(&370XnE);d1t0(b delta 14 Vcmcc1ewTg2ZAM1Z&370XnE);R1s(tZ diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index 92bbab77..bca67d24 100644 --- a/amt/locale/en_US/LC_MESSAGES/messages.po +++ b/amt/locale/en_US/LC_MESSAGES/messages.po @@ -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:35+0100\n" +"POT-Creation-Date: 2024-12-09 10:37+0100\n" "PO-Revision-Date: 0001-01-01 00:00+0000\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.mo b/amt/locale/nl_NL/LC_MESSAGES/messages.mo index a84759a86053d444e9617a99170983f29c50fb8d..53e0cd9c4721eea7d4c800e788af1aa361139477 100644 GIT binary patch delta 14 VcmaEy`#5*QBn3wE&65=Z!~iyk1_uBD delta 14 VcmaEy`#5*QBn3v(&65=Z!~iyY1_b~B diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index 8a18c99c..68ffbf9c 100644 --- a/amt/locale/nl_NL/LC_MESSAGES/messages.po +++ b/amt/locale/nl_NL/LC_MESSAGES/messages.po @@ -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:35+0100\n" +"POT-Creation-Date: 2024-12-09 10:37+0100\n" "PO-Revision-Date: 0001-01-01 00:00+0000\n" "Last-Translator: FULL NAME \n" "Language: nl_NL\n" diff --git a/tests/api/routes/test_algorithm.py b/tests/api/routes/test_algorithm.py index 6589fa2a..d537fb4c 100644 --- a/tests/api/routes/test_algorithm.py +++ b/tests/api/routes/test_algorithm.py @@ -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