From 5a190bba6312b38af6d031b165fbb9c8cdeec24c Mon Sep 17 00:00:00 2001 From: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com> Date: Sat, 6 Jun 2026 07:28:32 +0000 Subject: [PATCH] chore: improve metube maintenance path --- app/tests/test_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/tests/test_api.py b/app/tests/test_api.py index 9776856..38db142 100644 --- a/app/tests/test_api.py +++ b/app/tests/test_api.py @@ -157,6 +157,15 @@ async def test_add_invalid_json_body(mock_dqueue): await main.add(req) +@pytest.mark.asyncio +async def test_add_non_dict_json_body(mock_dqueue): + req = MagicMock(spec=web.Request) + req.json = AsyncMock(return_value=["not", "a", "dict"]) + with pytest.raises(web.HTTPBadRequest): + await main.add(req) + mock_dqueue.add.assert_not_called() + + @pytest.mark.asyncio async def test_add_invalid_ytdl_options_override_json(mock_dqueue): req = _json_request(_valid_video_add_body(ytdl_options_overrides="{bad json}"))