Bug ruff 2026 (#19)

* Updated Ruff to v0.16 and fixed for default checks 

* Nudge version and removed license classifier

---------

Co-authored-by: Jamie Hardt <jamie@squad51.us>
This commit is contained in:
Jamie Hardt
2026-09-19 16:35:56 -07:00
committed by GitHub
parent 2fc8a653cd
commit e0e3024280
39 changed files with 2031 additions and 1582 deletions
+58 -35
View File
@@ -1,25 +1,26 @@
import unittest
from ptulsconv.docparser import parse_document
import os.path
import unittest
from ptulsconv.docparser import parse_document
class TestRobinHood1(unittest.TestCase):
path = os.path.dirname(__file__) + '/../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 file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertIsNotNone(session.header)
self.assertEqual(session.header.session_name, 'Robin Hood Spotting')
self.assertEqual(session.header.session_name, "Robin Hood Spotting")
self.assertEqual(session.header.sample_rate, 48000.0)
self.assertEqual(session.header.bit_depth, 24)
self.assertEqual(session.header.timecode_fps, '29.97')
self.assertEqual(session.header.timecode_fps, "29.97")
self.assertEqual(session.header.timecode_drop_frame, False)
def test_all_sections(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertIsNotNone(session.header)
@@ -31,52 +32,74 @@ class TestRobinHood1(unittest.TestCase):
def test_tracks(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertEqual(len(session.tracks), 14)
self.assertListEqual(["Scenes", "Robin", "Will", "Marian", "John",
"Guy", "Much", "Butcher", "Town Crier",
"Soldier 1", "Soldier 2", "Soldier 3",
"Priest", "Guest at Court"],
list(map(lambda t: t.name, session.tracks)))
self.assertListEqual(["", "[ADR] {Actor=Errol Flynn} $CN=1",
"[ADR] {Actor=Patrick Knowles} $CN=2",
"[ADR] {Actor=Olivia DeHavilland} $CN=3",
"[ADR] {Actor=Claude Raines} $CN=4",
"[ADR] {Actor=Basil Rathbone} $CN=5",
"[ADR] {Actor=Herbert Mundin} $CN=6",
"[ADR] {Actor=George Bunny} $CN=101",
"[ADR] {Actor=Leonard Mundie} $CN=102",
"[ADR] $CN=103",
"[ADR] $CN=104",
"[ADR] $CN=105",
"[ADR] {Actor=Thomas R. Mills} $CN=106",
"[ADR] $CN=107"],
list(map(lambda t: t.comments, session.tracks)))
self.assertListEqual(
[
"Scenes",
"Robin",
"Will",
"Marian",
"John",
"Guy",
"Much",
"Butcher",
"Town Crier",
"Soldier 1",
"Soldier 2",
"Soldier 3",
"Priest",
"Guest at Court",
],
list(map(lambda t: t.name, session.tracks)),
)
self.assertListEqual(
[
"",
"[ADR] {Actor=Errol Flynn} $CN=1",
"[ADR] {Actor=Patrick Knowles} $CN=2",
"[ADR] {Actor=Olivia DeHavilland} $CN=3",
"[ADR] {Actor=Claude Raines} $CN=4",
"[ADR] {Actor=Basil Rathbone} $CN=5",
"[ADR] {Actor=Herbert Mundin} $CN=6",
"[ADR] {Actor=George Bunny} $CN=101",
"[ADR] {Actor=Leonard Mundie} $CN=102",
"[ADR] $CN=103",
"[ADR] $CN=104",
"[ADR] $CN=105",
"[ADR] {Actor=Thomas R. Mills} $CN=106",
"[ADR] $CN=107",
],
list(map(lambda t: t.comments, session.tracks)),
)
def test_a_track(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
guy_track = session.tracks[5]
self.assertEqual(guy_track.name, 'Guy')
self.assertEqual(guy_track.comments, '[ADR] {Actor=Basil Rathbone} $CN=5')
self.assertEqual(guy_track.name, "Guy")
self.assertEqual(guy_track.comments, "[ADR] {Actor=Basil Rathbone} $CN=5")
self.assertEqual(guy_track.user_delay_samples, 0)
self.assertListEqual(guy_track.state, [])
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_timecode, "01:04:19:15")
self.assertEqual(guy_track.clips[5].finish_timecode, "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')
self.assertEqual(guy_track.clips[5].state, "Unmuted")
def test_memory_locations(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertEqual(len(session.markers), 1)
@@ -86,5 +109,5 @@ class TestRobinHood1(unittest.TestCase):
self.assertEqual(session.markers[0].units, "Samples")
if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
+20 -16
View File
@@ -1,52 +1,56 @@
import unittest
from ptulsconv.docparser import parse_document
import os.path
import unittest
from ptulsconv.docparser import parse_document
class TestRobinHood5(unittest.TestCase):
path = os.path.dirname(__file__) + '/../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 file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertIsNone(session.files)
self.assertIsNone(session.clips)
def test_plugins(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertEqual(len(session.plugins), 2)
def test_stereo_track(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertEqual(session.tracks[1].name, 'MX WT (Stereo)')
self.assertEqual(session.tracks[1].name, "MX WT (Stereo)")
self.assertEqual(len(session.tracks[1].clips), 2)
self.assertEqual(session.tracks[1].clips[0].clip_name, 'RobinHood.1-01.L')
self.assertEqual(session.tracks[1].clips[1].clip_name, 'RobinHood.1-01.R')
self.assertEqual(session.tracks[1].clips[0].clip_name, "RobinHood.1-01.L")
self.assertEqual(session.tracks[1].clips[1].clip_name, "RobinHood.1-01.R")
def test_a_track(self):
with open(self.path,"r") as file:
with open(self.path, "r") as file:
session = parse_document(file.read())
guy_track = session.tracks[8]
self.assertEqual(guy_track.name, 'Guy')
self.assertEqual(guy_track.comments, '[ADR] {Actor=Basil Rathbone} $CN=5')
self.assertEqual(guy_track.name, "Guy")
self.assertEqual(guy_track.comments, "[ADR] {Actor=Basil Rathbone} $CN=5")
self.assertEqual(guy_track.user_delay_samples, 0)
self.assertListEqual(guy_track.state, ['Solo'])
self.assertListEqual(guy_track.state, ["Solo"])
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_timecode, "01:04:19:15.00")
self.assertEqual(guy_track.clips[5].finish_timecode, "01:04:21:28.00")
self.assertEqual(guy_track.clips[5].duration, "00:00:02:13.00")
self.assertEqual(guy_track.clips[5].timestamp, "01:04:19:09.70")
self.assertEqual(guy_track.clips[5].state, 'Unmuted')
self.assertEqual(guy_track.clips[5].state, "Unmuted")
if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
+18 -12
View File
@@ -1,33 +1,39 @@
import unittest
from ptulsconv.docparser import parse_document
import os.path
import unittest
from ptulsconv.docparser import parse_document
class TestRobinHood6(unittest.TestCase):
path = os.path.dirname(__file__) + '/../export_cases/Robin Hood Spotting6.txt'
path = os.path.dirname(__file__) + "/../export_cases/Robin Hood Spotting6.txt"
def test_a_track(self):
with open(self.path, "r") as file:
session = parse_document(file.read())
marian_track = session.tracks[6]
self.assertEqual(marian_track.name, 'Marian')
self.assertEqual(marian_track.comments, '[ADR] {Actor=Olivia DeHavilland} $CN=3')
self.assertEqual(marian_track.name, "Marian")
self.assertEqual(
marian_track.comments, "[ADR] {Actor=Olivia DeHavilland} $CN=3"
)
self.assertEqual(marian_track.user_delay_samples, 0)
self.assertListEqual(marian_track.state, ['Solo'])
self.assertListEqual(marian_track.state, ["Solo"])
self.assertEqual(len(marian_track.clips), 4)
self.assertListEqual(marian_track.plugins, ['Channel Strip (mono)', 'ReVibe II (mono/5.1)'])
self.assertListEqual(
marian_track.plugins, ["Channel Strip (mono)", "ReVibe II (mono/5.1)"]
)
self.assertEqual(marian_track.clips[2].channel, 1)
self.assertEqual(marian_track.clips[2].event, 3)
self.assertEqual(marian_track.clips[2].clip_name,
"\"Isn't that reason enough for a Royal Ward who must obey her guardian?\" $QN=M103")
self.assertEqual(
marian_track.clips[2].clip_name,
'"Isn\'t that reason enough for a Royal Ward who must obey her guardian?" $QN=M103',
)
self.assertEqual(marian_track.clips[2].start_timecode, "01:08:01:11")
self.assertEqual(marian_track.clips[2].finish_timecode, "01:08:04:24")
self.assertEqual(marian_track.clips[2].duration, "00:00:03:12")
self.assertEqual(marian_track.clips[2].timestamp, "01:08:01:11")
self.assertEqual(marian_track.clips[2].state, 'Unmuted')
self.assertEqual(marian_track.clips[2].state, "Unmuted")
if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
+12 -9
View File
@@ -1,16 +1,17 @@
import unittest
from ptulsconv.docparser import parse_document
import os.path
import unittest
from ptulsconv.docparser import parse_document
class TestRobinHoodDF(unittest.TestCase):
path = os.path.dirname(__file__) + '/../export_cases/Robin Hood SpottingDF.txt'
path = os.path.dirname(__file__) + "/../export_cases/Robin Hood SpottingDF.txt"
def test_header_export_df(self):
with open(self.path, "r") as file:
session = parse_document(file.read())
self.assertEqual(session.header.timecode_drop_frame, True)
def test_a_track(self):
@@ -19,16 +20,18 @@ class TestRobinHoodDF(unittest.TestCase):
session = parse_document(file.read())
guy_track = session.tracks[4]
self.assertEqual(guy_track.name, 'Robin')
self.assertEqual(guy_track.comments, '[ADR] {Actor=Errol Flynn} $CN=1')
self.assertEqual(guy_track.name, "Robin")
self.assertEqual(guy_track.comments, "[ADR] {Actor=Errol Flynn} $CN=1")
self.assertEqual(guy_track.user_delay_samples, 0)
self.assertListEqual(guy_track.state, [])
self.assertEqual(len(guy_track.clips), 10)
self.assertEqual(guy_track.clips[5].channel, 1)
self.assertEqual(guy_track.clips[5].event, 6)
self.assertEqual(guy_track.clips[5].clip_name, "\"Hold there! What's his fault?\" $QN=R106")
self.assertEqual(
guy_track.clips[5].clip_name, '"Hold there! What\'s his fault?" $QN=R106'
)
self.assertEqual(guy_track.clips[5].start_timecode, "01:05:30;15")
self.assertEqual(guy_track.clips[5].finish_timecode, "01:05:32;01")
self.assertEqual(guy_track.clips[5].duration, "00:00:01;16")
self.assertEqual(guy_track.clips[5].timestamp, None)
self.assertEqual(guy_track.clips[5].state, 'Unmuted')
self.assertEqual(guy_track.clips[5].state, "Unmuted")