コード例 #1
0
 def test_sami_with_p_and_span_align(self):
     """ <span> align DOES NOT override <p> align if it is specified inline.
     """
     caption_set = SAMIReader().read(SAMPLE_SAMI_WITH_P_AND_SPAN_ALIGN)
     caption = caption_set.get_captions('en-US')[0]
     self.assertEqual(caption.layout_info.alignment.horizontal,
                      HorizontalAlignmentEnum.RIGHT)
コード例 #2
0
 def test_sami_with_p_align(self):
     caption_set = SAMIReader().read(SAMPLE_SAMI_WITH_P_ALIGN)
     caption = caption_set.get_captions('en-US')[0]
     self.assertEqual(caption.layout_info.alignment.horizontal,
                      HorizontalAlignmentEnum.RIGHT)
コード例 #3
0
    def test_proper_timestamps(self):
        captions = SAMIReader().read(SAMPLE_SAMI)
        paragraph = captions.get_captions("en-US")[2]

        self.assertEqual(17000000, paragraph.start)
        self.assertEqual(18752000, paragraph.end)
コード例 #4
0
 def test_invalid_markup_is_properly_handled(self):
     captions = SAMIReader().read(SAMPLE_SAMI_SYNTAX_ERROR)
     self.assertEqual(2, len(captions.get_captions("en-US")))
コード例 #5
0
    def test_caption_length(self):
        captions = SAMIReader().read(SAMPLE_SAMI)

        self.assertEqual(7, len(captions.get_captions("en-US")))