This commit is contained in:
lphuc2250gma 2026-06-21 00:50:26 -10:00 committed by GitHub
commit ce920b1f00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -160,6 +160,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}"))