Page MenuHome

test_runner_merge_exr.py
No OneTemporary

test_runner_merge_exr.py

from pathlib import Path
from test_runner import AbstractCommandTest
class MergeProgressiveRendersCommandTest(AbstractCommandTest):
def setUp(self):
super().setUp()
from flamenco_worker.runner import MergeProgressiveRendersCommand
import tempfile
self.tmpdir = tempfile.TemporaryDirectory()
self.mypath = Path(__file__).parent
self.cmd = MergeProgressiveRendersCommand(
worker=self.fworker,
task_id='12345',
command_idx=0,
)
def tearDown(self):
super().tearDown()
del self.tmpdir
def test_happy_flow(self):
output = Path(self.tmpdir.name) / 'merged.exr'
settings = {
'blender_cmd': self.find_blender_cmd(),
'input1': str(self.mypath / 'Corn field-1k.exr'),
'input2': str(self.mypath / 'Deventer-1k.exr'),
'weight1': 20,
'weight2': 100,
'output': str(output)
}
task = self.cmd.run(settings)
ok = self.loop.run_until_complete(task)
self.assertTrue(ok)
# Assuming that if the files exist, the merge was ok.
self.assertTrue(output.exists())
self.assertTrue(output.is_file())
self.assertTrue(output.with_suffix('.jpg').exists())
self.assertTrue(output.with_suffix('.jpg').is_file())

File Metadata

Mime Type
text/x-python
Expires
Sun, Jul 3, 11:54 AM (1 d, 23 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ea/50/3bcc7ac22cf57d2f788af51a6287

Event Timeline