forked from LBRYCommunity/lbry-sdk
add unit test and debug output
This commit is contained in:
parent
c90db54a3d
commit
98e6a066f4
2 changed files with 7 additions and 2 deletions
|
@ -37,10 +37,10 @@ class VideoFileAnalyzer:
|
||||||
try:
|
try:
|
||||||
version, code = await self._execute(name, "-version")
|
version, code = await self._execute(name, "-version")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning("Unable to run %s, but it was requested. Message: %s", name, str(e))
|
|
||||||
code = -1
|
code = -1
|
||||||
version = ""
|
version = str(e)
|
||||||
if code != 0 or not version.startswith(name):
|
if code != 0 or not version.startswith(name):
|
||||||
|
log.warning("Unable to run %s, but it was requested. Code: %d; Message: %s", name, code, version)
|
||||||
raise FileNotFoundError(f"Unable to locate or run {name}. Please install FFmpeg "
|
raise FileNotFoundError(f"Unable to locate or run {name}. Please install FFmpeg "
|
||||||
f"and ensure that it is callable via PATH or conf.ffmpeg_folder")
|
f"and ensure that it is callable via PATH or conf.ffmpeg_folder")
|
||||||
return version
|
return version
|
||||||
|
|
|
@ -93,6 +93,11 @@ class TranscodeValidation(ClaimTestCase):
|
||||||
fixed_file = await self.analyzer.verify_or_repair(True, True, file_name)
|
fixed_file = await self.analyzer.verify_or_repair(True, True, file_name)
|
||||||
pathlib.Path(fixed_file).unlink()
|
pathlib.Path(fixed_file).unlink()
|
||||||
|
|
||||||
|
async def test_max_bit_rate(self):
|
||||||
|
self.conf.video_bitrate_maximum = 100
|
||||||
|
with self.assertRaisesRegex(Exception, "The bit rate is above the configured maximum"):
|
||||||
|
await self.analyzer.verify_or_repair(True, False, self.video_file_name)
|
||||||
|
|
||||||
async def test_video_format(self):
|
async def test_video_format(self):
|
||||||
file_name = self.make_name("bad_video_format_1")
|
file_name = self.make_name("bad_video_format_1")
|
||||||
if not file_name.exists():
|
if not file_name.exists():
|
||||||
|
|
Loading…
Reference in a new issue