mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2026-01-02 01:40:49 +00:00
Test file reformatting, cleanup file paths
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import ptulsconv
|
import ptulsconv
|
||||||
import pprint
|
import pprint
|
||||||
|
import os.path
|
||||||
|
|
||||||
|
|
||||||
class TestRobinHood1(unittest.TestCase):
|
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):
|
def test_header_export(self):
|
||||||
with open(self.path, 'r') as f:
|
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]['start_time'], "01:04:19:15")
|
||||||
self.assertEqual(guy_track['clips'][5]['end_time'], "01:04:21:28")
|
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]['duration'], "00:00:02:13")
|
||||||
|
self.assertEqual(guy_track['clips'][5]['timestamp'], None)
|
||||||
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
|
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import ptulsconv
|
import ptulsconv
|
||||||
from pprint import pprint
|
import os.path
|
||||||
|
|
||||||
|
|
||||||
class TestRobinHood5(unittest.TestCase):
|
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):
|
def test_plugins(self):
|
||||||
with open(self.path, 'r') as f:
|
with open(self.path, 'r') as f:
|
||||||
@@ -44,6 +53,5 @@ class TestRobinHood5(unittest.TestCase):
|
|||||||
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
|
self.assertEqual(guy_track['clips'][5]['state'], 'Unmuted')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user