Example #1
0
 def check_parsing(self, content, correct_subs):
     subtitles = TXTParser.parse(content).to_internal().subtitle_items(
         mappings=TXTGenerator.MAPPINGS)
     self.assertEqual([s.text for s in subtitles], correct_subs)
     for sub in subtitles:
         self.assertEqual(sub.start_time, None)
         self.assertEqual(sub.end_time, None)
Example #2
0
 def check_parsing(self, content, correct_subs):
     subtitles = TXTParser.parse(content).to_internal().subtitle_items(
         mappings=TXTGenerator.MAPPINGS)
     self.assertEqual([s.text for s in subtitles], correct_subs)
     for sub in subtitles:
         self.assertEqual(sub.start_time, None)
         self.assertEqual(sub.end_time, None)
Example #3
0
    def test_linebreaks(self):
        input_str = '''hey
        hey2
        hey3

        second line'''
        subs = TXTParser.parse(input_str)
        self.assertEqual(len(subs), 2)
Example #4
0
    def test_linebreaks(self):
        input_str = '''hey
        hey2
        hey3

        second line'''
        subs = TXTParser.parse(input_str)
        self.assertEqual(len(subs), 2)
Example #5
0
 def test_basic(self):
     subs = TXTParser.parse(TXT_TEXT.encode('utf-8'))
     self.assertEquals(len(subs), 2)
     [x for x in subs.to_internal().subtitle_items()]
Example #6
0
 def test_basic(self):
     subs = TXTParser.parse(TXT_TEXT.encode('utf-8'))
     self.assertEquals(len(subs), 2)
     [x for x in subs.to_internal().subtitle_items()]