Test file reformatting, cleanup file paths

This commit is contained in:
Jamie Hardt
2019-10-06 22:42:03 -07:00
parent b90045cc6b
commit 9d9c2eb237
2 changed files with 23 additions and 11 deletions

View File

@@ -1,9 +1,11 @@
import unittest
import ptulsconv
import pprint
import os.path
class TestRobinHood1(unittest.TestCase):
path = 'tests/export_cases/Robin Hood Spotting.txt'
path = os.path.dirname(__file__) + '/export_cases/Robin Hood Spotting.txt'
def test_header_export(self):
with open(self.path, 'r') as f:
@@ -73,7 +75,9 @@ class TestRobinHood1(unittest.TestCase):
self.assertEqual(guy_track['clips'][5]['start_time'], "01:04:19:15")
self.assertEqual(guy_track['clips'][5]['end_time'], "01:04:21:28")
self.assertEqual(guy_track['clips'][5]['duration'], "00:00:02:13")
self.assertEqual(guy_track['clips'][5]['timestamp'], None)
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
if __name__ == '__main__':
unittest.main()

View File

@@ -1,9 +1,18 @@
import unittest
import ptulsconv
from pprint import pprint
import os.path
class TestRobinHood5(unittest.TestCase):
path = 'tests/export_cases/Robin Hood Spotting5.txt'
path = os.path.dirname(__file__) + '/export_cases/Robin Hood Spotting5.txt'
def test_skipped_segments(self):
with open(self.path, 'r') as f:
visitor = ptulsconv.PTTextVisitor()
result = ptulsconv.protools_text_export_grammar.parse(f.read())
parsed: dict = visitor.visit(result)
self.assertIsNone(parsed['files'])
self.assertIsNone(parsed['clips'])
def test_plugins(self):
with open(self.path, 'r') as f:
@@ -44,6 +53,5 @@ class TestRobinHood5(unittest.TestCase):
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
if __name__ == '__main__':
unittest.main()