mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2026-01-01 09:20:49 +00:00
Test file reformatting, cleanup file paths
This commit is contained in:
@@ -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:
|
||||
@@ -26,7 +35,7 @@ class TestRobinHood5(unittest.TestCase):
|
||||
with open(self.path, 'r') as f:
|
||||
visitor = ptulsconv.PTTextVisitor()
|
||||
result = ptulsconv.protools_text_export_grammar.parse(f.read())
|
||||
parsed :dict = visitor.visit(result)
|
||||
parsed: dict = visitor.visit(result)
|
||||
|
||||
guy_track = parsed['tracks'][8]
|
||||
self.assertEqual(guy_track['name'], 'Guy')
|
||||
@@ -36,7 +45,7 @@ class TestRobinHood5(unittest.TestCase):
|
||||
self.assertEqual(len(guy_track['clips']), 16)
|
||||
self.assertEqual(guy_track['clips'][5]['channel'], 1)
|
||||
self.assertEqual(guy_track['clips'][5]['event'], 6)
|
||||
self.assertEqual(guy_track['clips'][5]['clip_name'], "\"What's your name? You Saxon dog!\" $QN=GY106" )
|
||||
self.assertEqual(guy_track['clips'][5]['clip_name'], "\"What's your name? You Saxon dog!\" $QN=GY106")
|
||||
self.assertEqual(guy_track['clips'][5]['start_time'], "01:04:19:15.00")
|
||||
self.assertEqual(guy_track['clips'][5]['end_time'], "01:04:21:28.00")
|
||||
self.assertEqual(guy_track['clips'][5]['duration'], "00:00:02:13.00")
|
||||
@@ -44,6 +53,5 @@ class TestRobinHood5(unittest.TestCase):
|
||||
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user