fix test
This commit is contained in:
parent
b68fba2825
commit
b9ad72430d
2 changed files with 8 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
from typing import List
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import mediafile
|
import mediafile
|
||||||
|
|
@ -43,7 +44,7 @@ class EmbedThumbnailPlugin(Plugin[EmbedThumbnailOptions]):
|
||||||
thumbnail_path = entry.get_download_thumbnail_path()
|
thumbnail_path = entry.get_download_thumbnail_path()
|
||||||
tmp_file_path = FFMPEG.tmp_file_path(file_path)
|
tmp_file_path = FFMPEG.tmp_file_path(file_path)
|
||||||
try:
|
try:
|
||||||
cmd = [
|
ffmpeg_args: List[str] = [
|
||||||
"-i",
|
"-i",
|
||||||
file_path,
|
file_path,
|
||||||
"-i",
|
"-i",
|
||||||
|
|
@ -60,7 +61,7 @@ class EmbedThumbnailPlugin(Plugin[EmbedThumbnailOptions]):
|
||||||
"attached_pic",
|
"attached_pic",
|
||||||
tmp_file_path,
|
tmp_file_path,
|
||||||
]
|
]
|
||||||
FFMPEG.run(cmd)
|
FFMPEG.run(ffmpeg_args)
|
||||||
FileHandler.move(tmp_file_path, file_path)
|
FileHandler.move(tmp_file_path, file_path)
|
||||||
finally:
|
finally:
|
||||||
FileHandler.delete(tmp_file_path)
|
FileHandler.delete(tmp_file_path)
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,11 @@ class TestConfigFilePartiallyValidatesPresets:
|
||||||
|
|
||||||
@pytest.mark.parametrize("plugin", PluginMapping.plugins())
|
@pytest.mark.parametrize("plugin", PluginMapping.plugins())
|
||||||
def test_success__empty_plugins(self, plugin: str):
|
def test_success__empty_plugins(self, plugin: str):
|
||||||
self._partial_validate({plugin: {}})
|
excluded_plugins = [
|
||||||
|
"embed_thumbnail", # value is bool, not dict
|
||||||
|
]
|
||||||
|
if plugin not in excluded_plugins:
|
||||||
|
self._partial_validate({plugin: {}})
|
||||||
|
|
||||||
@pytest.mark.parametrize("source", DownloadStrategyMapping.sources())
|
@pytest.mark.parametrize("source", DownloadStrategyMapping.sources())
|
||||||
def test_success__empty_sources(self, source: str):
|
def test_success__empty_sources(self, source: str):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue