Updated tests

This commit is contained in:
Jamie Hardt
2023-07-21 12:44:42 -07:00
parent 58277367c5
commit 4e64edcd85
5 changed files with 34 additions and 14 deletions

View File

@@ -7,8 +7,8 @@ class TestRobinHood1(unittest.TestCase):
path = os.path.dirname(__file__) + '/../export_cases/Robin Hood Spotting.txt'
def test_header_export(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertIsNotNone(session.header)
self.assertEqual(session.header.session_name, 'Robin Hood Spotting')
@@ -19,7 +19,8 @@ class TestRobinHood1(unittest.TestCase):
def test_all_sections(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertIsNotNone(session.header)
self.assertIsNotNone(session.files)
@@ -30,7 +31,8 @@ class TestRobinHood1(unittest.TestCase):
def test_tracks(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertEqual(len(session.tracks), 14)
self.assertListEqual(["Scenes", "Robin", "Will", "Marian", "John",
@@ -54,7 +56,10 @@ class TestRobinHood1(unittest.TestCase):
list(map(lambda t: t.comments, session.tracks)))
def test_a_track(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
guy_track = session.tracks[5]
self.assertEqual(guy_track.name, 'Guy')
self.assertEqual(guy_track.comments, '[ADR] {Actor=Basil Rathbone} $CN=5')
@@ -71,7 +76,8 @@ class TestRobinHood1(unittest.TestCase):
self.assertEqual(guy_track.clips[5].state, 'Unmuted')
def test_memory_locations(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertEqual(len(session.markers), 1)
self.assertEqual(session.markers[0].number, 1)

View File

@@ -7,23 +7,30 @@ class TestRobinHood5(unittest.TestCase):
path = os.path.dirname(__file__) + '/../export_cases/Robin Hood Spotting5.txt'
def test_skipped_segments(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertIsNone(session.files)
self.assertIsNone(session.clips)
def test_plugins(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertEqual(len(session.plugins), 2)
def test_stereo_track(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
self.assertEqual(session.tracks[1].name, 'MX WT (Stereo)')
self.assertEqual(len(session.tracks[1].clips), 2)
self.assertEqual(session.tracks[1].clips[0].clip_name, 'RobinHood.1-01.L')
self.assertEqual(session.tracks[1].clips[1].clip_name, 'RobinHood.1-01.R')
def test_a_track(self):
session = parse_document(self.path)
with open(self.path,"r") as file:
session = parse_document(file.read())
guy_track = session.tracks[8]
self.assertEqual(guy_track.name, 'Guy')

View File

@@ -7,7 +7,9 @@ class TestRobinHood6(unittest.TestCase):
path = os.path.dirname(__file__) + '/../export_cases/Robin Hood Spotting6.txt'
def test_a_track(self):
session = parse_document(self.path)
with open(self.path, "r") as file:
session = parse_document(file.read())
marian_track = session.tracks[6]
self.assertEqual(marian_track.name, 'Marian')

View File

@@ -7,11 +7,16 @@ class TestRobinHoodDF(unittest.TestCase):
path = os.path.dirname(__file__) + '/../export_cases/Robin Hood SpottingDF.txt'
def test_header_export_df(self):
session = parse_document(self.path)
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertEqual(session.header.timecode_drop_frame, True)
def test_a_track(self):
session = parse_document(self.path)
with open(self.path, "r") as file:
session = parse_document(file.read())
guy_track = session.tracks[4]
self.assertEqual(guy_track.name, 'Robin')

View File

@@ -20,7 +20,7 @@ class TestPDFExport(unittest.TestCase):
tempdir = tempfile.TemporaryDirectory()
os.chdir(tempdir.name)
try:
commands.convert(path, major_mode='doc')
commands.convert(input_file=path, major_mode='doc')
except:
assert False, "Error processing file %s" % path
finally: