From dc98894eb4ab321e39a6812082cd1ab36d8cb8ca 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 733 -> 733 bytes amt/locale/en_US/LC_MESSAGES/messages.po | 2 +- amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 13857 -> 13857 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 1be54bd8..fa449243 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: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 \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 b1ccf4cb3e86f400542905c182a3fbcbab4d3d03..014aae8342396ff14932b5609ec41d9397353a25 100644 GIT binary patch delta 15 Wcmcc1dY5&BHY1af;bvXN4U7OPF9etX delta 15 Wcmcc1dY5&BHY1av#b#Z`4U7OPQUsm= diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index 45b66641..f5d59770 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: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 \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 06fe9d17b7564f6517da5cb73f6e1934188fb391..9c24cb4810a4d6196aac19744ec1a7690c244a24 100644 GIT binary patch delta 15 WcmZ3OvoL3afdZ3};btR+_o4tWVFif* delta 15 WcmZ3OvoL3afdZ4E#bzUg_o4tWgawZP diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index 4c7aa6d3..aac10ca8 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: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 \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