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)
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)
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)
def test_invalid_markup_is_properly_handled(self): captions = SAMIReader().read(SAMPLE_SAMI_SYNTAX_ERROR) self.assertEqual(2, len(captions.get_captions("en-US")))
def test_caption_length(self): captions = SAMIReader().read(SAMPLE_SAMI) self.assertEqual(7, len(captions.get_captions("en-US")))