mirror of
https://github.com/iluvcapra/pycmx.git
synced 2026-01-02 01:40:58 +00:00
Update test_parse.py
Some more tests
This commit is contained in:
@@ -4,7 +4,6 @@ import pycmx
|
|||||||
|
|
||||||
class TestParse(TestCase):
|
class TestParse(TestCase):
|
||||||
|
|
||||||
def test_event_counts(self):
|
|
||||||
files = ["INS4_R1_010417.edl" ,
|
files = ["INS4_R1_010417.edl" ,
|
||||||
"INS4_R1_DX_092117.edl",
|
"INS4_R1_DX_092117.edl",
|
||||||
"STP R1 v082517.edl",
|
"STP R1 v082517.edl",
|
||||||
@@ -14,14 +13,32 @@ class TestParse(TestCase):
|
|||||||
"INS4_R1_DX_092117.edl"
|
"INS4_R1_DX_092117.edl"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def test_event_counts(self):
|
||||||
|
|
||||||
counts = [ 287, 466, 250 , 376, 120 , 3 , 466 ]
|
counts = [ 287, 466, 250 , 376, 120 , 3 , 466 ]
|
||||||
|
|
||||||
for fn, count in zip(files, counts):
|
for fn, count in zip(type(self).files, counts):
|
||||||
with open(f"tests/edls/{fn}" ,'r') as f:
|
with open(f"tests/edls/{fn}" ,'r') as f:
|
||||||
edl = pycmx.parse_cmx3600(f)
|
edl = pycmx.parse_cmx3600(f)
|
||||||
actual = len( list( edl.events ))
|
actual = len( list( edl.events ))
|
||||||
self.assertTrue( actual == count , f"expected {count} in file {fn} but found {actual}")
|
self.assertTrue( actual == count , f"expected {count} in file {fn} but found {actual}")
|
||||||
|
|
||||||
|
def test_list_sanity(self):
|
||||||
|
for fn in type(self).files:
|
||||||
|
with open(f"tests/edls/{fn}" ,'r') as f:
|
||||||
|
edl = pycmx.parse_cmx3600(f)
|
||||||
|
self.assertTrue( type(edl.title) is str )
|
||||||
|
|
||||||
|
|
||||||
|
def test_event_sanity(self):
|
||||||
|
for fn in type(self).files:
|
||||||
|
with open(f"tests/edls/{fn}" ,'r') as f:
|
||||||
|
edl = pycmx.parse_cmx3600(f)
|
||||||
|
for index, event in enumerate(edl.events):
|
||||||
|
self.assertTrue( len(event.edits) > 0 )
|
||||||
|
self.assertTrue( event.number == index + 1 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_events(self):
|
def test_events(self):
|
||||||
with open("tests/edls/TEST.edl",'r') as f:
|
with open("tests/edls/TEST.edl",'r') as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user