Skip to content

Commit a60f726

Browse files
committed
move stl ebu 1991 tests to pycaption / enable python 3.12
1 parent ac14426 commit a60f726

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

pycaption/stl/ebu_stl_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def decode(self, input, errors="strict"):
238238
return output, len(input)
239239

240240
def search(name):
241-
if name in ("iso6937", "iso_6937-2"):
241+
if name in ("iso6937", "iso_6937-2", "iso_6937_2"):
242242
return codecs.CodecInfo(
243243
name="iso_6937-2",
244244
encode=iso6937().encode,

tests/ebu1991/test.stl

62.8 KB
Binary file not shown.

tests/ebu1991/test2.stl

13 KB
Binary file not shown.

tests/test_stl.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
from os.path import join, dirname, abspath
3+
4+
from pycaption.stl.ebu_stl_reader import STLReader
5+
6+
7+
class SRTtoWebVTTTestCase(unittest.TestCase):
8+
directory = join(dirname(abspath(__file__)))
9+
def test_stl(self):
10+
stl = STLReader()
11+
content = open(join(self.directory, "ebu1991", "test.stl"), "rb").read()
12+
self.assertTrue(stl.detect(content))
13+
captions = stl.read(content)
14+
15+
self.assertEqual(len(captions.get_captions("de")), 494)

0 commit comments

Comments
 (0)