Update test_parse.py

Some more tests
This commit is contained in:
Jamie Hardt
2018-12-26 17:30:19 -08:00
parent fbb2b8700d
commit 4ceb4be7ab

View File

@@ -4,7 +4,6 @@ import pycmx
class TestParse(TestCase):
def test_event_counts(self):
files = ["INS4_R1_010417.edl" ,
"INS4_R1_DX_092117.edl",
"STP R1 v082517.edl",
@@ -14,14 +13,32 @@ class TestParse(TestCase):
"INS4_R1_DX_092117.edl"
]
def test_event_counts(self):
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:
edl = pycmx.parse_cmx3600(f)
actual = len( list( edl.events ))
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):
with open("tests/edls/TEST.edl",'r') as f: