Skip to content
Snippets Groups Projects
Commit 9e291e94 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

More Windows compatibility fixes

parent 75f5ca13
No related branches found
No related tags found
No related merge requests found
......@@ -1171,10 +1171,10 @@ class ConcatenateVideosCommand(AbstractFFmpegCommand):
args = [
'-f', 'concat',
'-i', str(self.index_file),
'-i', self.index_file.as_posix(),
'-c', 'copy',
'-y',
str(output_file),
output_file.as_posix(),
]
return args
......
......@@ -88,7 +88,7 @@ class BlenderRenderTest(AbstractCommandTest):
"""Test that CLI arguments in the blender_cmd setting are handled properly."""
from tests.mock_responses import CoroMock
filepath = str(Path(__file__).parent)
filepath = Path(__file__).parent.as_posix()
settings = {
# Point blender_cmd to this file so that we're sure it exists.
'blender_cmd': f'{self.thisfile!r} --with --cli="args for CLI"',
......@@ -122,7 +122,7 @@ class BlenderRenderTest(AbstractCommandTest):
def test_python_expr(self):
from tests.mock_responses import CoroMock
filepath = str(Path(__file__).parent)
filepath = Path(__file__).parent.as_posix()
settings = {
# Point blender_cmd to this file so that we're sure it exists.
'blender_cmd': f'{self.thisfile!r} --with --cli="args for CLI"',
......@@ -140,7 +140,7 @@ class BlenderRenderTest(AbstractCommandTest):
self.loop.run_until_complete(self.cmd.run(settings))
mock_cse.assert_called_once_with(
__file__,
self.thisfile,
'--with',
'--cli=args for CLI',
'--enable-autoexec',
......
......@@ -16,6 +16,8 @@ bpy.ops.wm.quit_blender()
class RenderAudioTest(AbstractCommandTest):
thisfile = Path(__file__).as_posix()
def setUp(self):
super().setUp()
......@@ -30,13 +32,12 @@ class RenderAudioTest(AbstractCommandTest):
def test_cli_args(self):
from tests.mock_responses import CoroMock
filepath = Path(__file__)
settings = {
# Point blender_cmd to this file so that we're sure it exists.
'blender_cmd': '%s --with --cli="args for CLI"' % __file__,
'blender_cmd': f'{self.thisfile!r} --with --cli="args for CLI"',
'frame_start': 1,
'frame_end': 47,
'filepath': str(filepath),
'filepath': self.thisfile,
'render_output': '/tmp/output.flac',
}
......@@ -47,13 +48,13 @@ class RenderAudioTest(AbstractCommandTest):
self.loop.run_until_complete(self.cmd.run(settings))
mock_cse.assert_called_once_with(
__file__,
self.thisfile,
'--with',
'--cli=args for CLI',
'--enable-autoexec',
'-noaudio',
'--background',
str(filepath),
self.thisfile,
'--python-exit-code', '47',
'--python-expr', expected_script,
stdin=subprocess.DEVNULL,
......
......@@ -15,7 +15,7 @@ frame_dir = Path(__file__).with_name('test_frames')
class ConcatVideosTest(AbstractCommandTest):
settings: typing.Dict[str, typing.Any] = {
'ffmpeg_cmd': f'"{sys.executable}" -hide_banner',
'ffmpeg_cmd': f'{Path(sys.executable).absolute().as_posix()!r} -hide_banner',
'input_files': str(frame_dir / 'chunk-*.mkv'),
'output_file': '/tmp/merged.mkv',
}
......@@ -37,9 +37,9 @@ class ConcatVideosTest(AbstractCommandTest):
cliargs = self.cmd._build_ffmpeg_command(self.settings)
self.assertEqual([
sys.executable, '-hide_banner',
Path(sys.executable).as_posix(), '-hide_banner',
'-f', 'concat',
'-i', str(frame_dir / 'ffmpeg-input.txt'),
'-i', (frame_dir / 'ffmpeg-input.txt').as_posix(),
'-c', 'copy',
'-y',
'/tmp/merged.mkv',
......@@ -51,7 +51,7 @@ class ConcatVideosTest(AbstractCommandTest):
settings: typing.Dict[str, typing.Any] = {
**self.settings,
'ffmpeg_cmd': 'ffmpeg', # use the real FFmpeg for this test.
'output_file': str(outfile),
'output_file': outfile.as_posix(),
}
self.loop.run_until_complete(self.cmd.run(settings))
......@@ -60,7 +60,7 @@ class ConcatVideosTest(AbstractCommandTest):
ffprobe_cmd = [shutil.which('ffprobe'), '-v', 'error',
'-show_entries', 'format=duration',
'-of', 'default=noprint_wrappers=1:nokey=1',
str(outfile)]
outfile.as_posix()]
log.debug('Running %s', ' '.join(shlex.quote(arg) for arg in ffprobe_cmd))
probe_out = subprocess.check_output(ffprobe_cmd)
probed_duration = float(probe_out)
......
......@@ -14,7 +14,7 @@ log = logging.getLogger(__name__)
class CreateVideoTest(AbstractCommandTest):
settings: typing.Dict[str, typing.Any] = {
'ffmpeg_cmd': f'"{sys.executable}" -hide_banner',
'ffmpeg_cmd': f'{Path(sys.executable).absolute().as_posix()!r} -hide_banner',
'input_files': '/tmp/*.png',
'output_file': '/tmp/merged.mkv',
'fps': 24,
......@@ -49,7 +49,7 @@ class CreateVideoTest(AbstractCommandTest):
cliargs = self.cmd._build_ffmpeg_command(self.settings)
self.assertEqual([
sys.executable, '-hide_banner',
Path(sys.executable).absolute().as_posix(), '-hide_banner',
'-pattern_type', 'glob',
'-r', '24',
'-i', '/tmp/*.png',
......@@ -68,8 +68,8 @@ class CreateVideoTest(AbstractCommandTest):
settings: typing.Dict[str, typing.Any] = {
**self.settings,
'ffmpeg_cmd': 'ffmpeg', # use the real FFmpeg for this test.
'input_files': f'{frame_dir}/*.png',
'output_file': str(outfile),
'input_files': f'{frame_dir.as_posix()}/*.png',
'output_file': outfile.as_posix(),
}
self.loop.run_until_complete(self.cmd.run(settings))
......@@ -78,7 +78,7 @@ class CreateVideoTest(AbstractCommandTest):
ffprobe_cmd = [shutil.which('ffprobe'), '-v', 'error',
'-show_entries', 'format=duration',
'-of', 'default=noprint_wrappers=1:nokey=1',
str(outfile)]
outfile.as_posix()]
log.debug('Running %s', ' '.join(shlex.quote(arg) for arg in ffprobe_cmd))
probe_out = subprocess.check_output(ffprobe_cmd)
probed_duration = float(probe_out)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment