Fixed errors with track_index field

In tests
This commit is contained in:
Jamie Hardt
2023-07-27 23:15:49 -07:00
parent 81909c8a51
commit dfde3c4493
2 changed files with 11 additions and 5 deletions

View File

@@ -108,8 +108,12 @@ def parse_document(session_text: str) -> SessionDescriptor:
class DocParserVisitor(NodeVisitor): class DocParserVisitor(NodeVisitor):
@staticmethod def __init__(self):
def visit_document(_, visited_children) -> SessionDescriptor: self.track_index = 0
# @staticmethod
def visit_document(self, _, visited_children) -> SessionDescriptor:
self.track_index = 0
files = next(iter(visited_children[1]), None) files = next(iter(visited_children[1]), None)
clips = next(iter(visited_children[2]), None) clips = next(iter(visited_children[2]), None)
plugins = next(iter(visited_children[3]), None) plugins = next(iter(visited_children[3]), None)
@@ -196,8 +200,8 @@ class DocParserVisitor(NodeVisitor):
def visit_frame_rate(node, _): def visit_frame_rate(node, _):
return node.text return node.text
def visit_track_listing(self, _, visited_children): @staticmethod
self.track_index = 0 def visit_track_listing(_, visited_children):
return visited_children[1] return visited_children[1]
@staticmethod @staticmethod

View File

@@ -88,7 +88,9 @@ class TestTagCompiler(unittest.TestCase):
state='Unmuted', state='Unmuted',
timestamp=None), timestamp=None),
] ]
test_track = doc_entity.TrackDescriptor(name="Track 1 [A] {Color=Red} $Mode=1", test_track = doc_entity.TrackDescriptor(
index=0,
name="Track 1 [A] {Color=Red} $Mode=1",
comments="{Comment=This is some text in the comments}", comments="{Comment=This is some text in the comments}",
user_delay_samples=0, user_delay_samples=0,
plugins=[], plugins=[],