mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Reorganized trst sources
This commit is contained in:
38
tests/unittests/test_adr_entity.py
Normal file
38
tests/unittests/test_adr_entity.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import unittest
|
||||
|
||||
from ptulsconv.docparser.tag_compiler import Event
|
||||
from ptulsconv.docparser.adr_entity import ADRLine, make_entity
|
||||
from fractions import Fraction
|
||||
|
||||
|
||||
class TestADREntity(unittest.TestCase):
|
||||
def test_event2line(self):
|
||||
tags = {
|
||||
'Ver': '1.0',
|
||||
'Actor': "Bill",
|
||||
'CN': "1",
|
||||
'QN': 'J1001',
|
||||
'R': 'Noise',
|
||||
'EFF': 'EFF'
|
||||
}
|
||||
event = Event(clip_name='"This is a test." (sotto voce)',
|
||||
track_name="Justin",
|
||||
session_name="Test Project",
|
||||
tags=tags,
|
||||
start=Fraction(0, 1), finish=Fraction(1, 1))
|
||||
|
||||
line = make_entity(event)
|
||||
|
||||
self.assertIsInstance(line, ADRLine)
|
||||
self.assertEqual('Bill', line.actor_name)
|
||||
self.assertEqual('Justin', line.character_name)
|
||||
self.assertEqual('"This is a test." (sotto voce)', line.prompt)
|
||||
self.assertEqual('Noise', line.reason)
|
||||
self.assertEqual('J1001', line.cue_number)
|
||||
self.assertEqual(True, line.effort)
|
||||
self.assertEqual('Test Project', line.title)
|
||||
self.assertEqual('1.0', line.version)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user