Repository navigation
Expand file tree
/
Copy pathexecutor_test.py
More file actions
36 lines (26 loc) · 1.95 KB
/
Copy pathexecutor_test.py
File metadata and controls
36 lines (26 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import unittest
from vmaf.core.asset import Asset
from vmaf.core.executor import Executor
__copyright__ = "Copyright 2016-2019, Netflix, Inc."
__license__ = "Apache, Version 2.0"
class ExecutorTest(unittest.TestCase):
def test_get_workfile_yuv_type(self):
asset = Asset(dataset="test", content_id=0, asset_id=0, ref_path="", dis_path="",
asset_dict={}, workdir_root="my_workdir_root")
self.assertEqual(Executor._get_workfile_yuv_type(asset), 'yuv420p')
asset = Asset(dataset="test", content_id=0, asset_id=0, ref_path="", dis_path="",
asset_dict={'ref_yuv_type': 'notyuv', 'dis_yuv_type': 'notyuv'}, workdir_root="my_workdir_root")
self.assertEqual(Executor._get_workfile_yuv_type(asset), 'yuv420p')
asset = Asset(dataset="test", content_id=0, asset_id=0, ref_path="", dis_path="",
asset_dict={'ref_yuv_type': 'yuv444p', 'dis_yuv_type': 'notyuv'}, workdir_root="my_workdir_root")
self.assertEqual(Executor._get_workfile_yuv_type(asset), 'yuv444p')
with self.assertRaises(AssertionError):
asset = Asset(dataset="test", content_id=0, asset_id=0, ref_path="", dis_path="",
asset_dict={'ref_yuv_type': 'yuv444p', 'dis_yuv_type': 'yuv420p'}, workdir_root="my_workdir_root")
self.assertEqual(Executor._get_workfile_yuv_type(asset), 'yuv444p')
asset = Asset(dataset="test", content_id=0, asset_id=0, ref_path="", dis_path="",
asset_dict={'ref_yuv_type': 'notyuv', 'dis_yuv_type': 'yuv422p'}, workdir_root="my_workdir_root")
self.assertEqual(Executor._get_workfile_yuv_type(asset), 'yuv422p')
asset = Asset(dataset="test", content_id=0, asset_id=0, ref_path="", dis_path="",
asset_dict={'ref_yuv_type': 'yuv444p', 'dis_yuv_type': 'yuv444p'}, workdir_root="my_workdir_root")
self.assertEqual(Executor._get_workfile_yuv_type(asset), 'yuv444p')