chore: improve metube maintenance path
This commit is contained in:
parent
ee20512410
commit
5a190bba63
1 changed files with 9 additions and 0 deletions
|
|
@ -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}"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue