Ejemplo n.º 1
0
class TestTTMLWriter(unittest.TestCase):
    def setUp(self):
        self.writer = Writer(StringIO())

    def test_captions_to_text(self):
        caption = core.Caption()
        start = datetime(year=1901, month=1, day=1, hour=0, minute=0, second=3)
        caption.start = start
        caption.duration = timedelta(2.0/24/60/60)
        caption.text = u"My first caption"

        self.writer.captions = [caption]
        content = self.writer.captions_to_text()
        self.assertTrue(content is not None)
        self.assertTrue(content.startswith(u'<tt'))
        self.assertTrue(u"""<p begin="00:00:03" end="00:00:05">My first caption</p>""" in content)
Ejemplo n.º 2
0
class TestTTMLWriter(unittest.TestCase):
    def setUp(self):
        self.writer = Writer(StringIO())

    def test_captions_to_text(self):
        caption = core.Caption()
        start = datetime(year=1901, month=1, day=1, hour=0, minute=0, second=3)
        caption.start = start
        caption.duration = timedelta(2.0 / 24 / 60 / 60)
        caption.text = u"My first caption"

        self.writer.captions = [caption]
        content = self.writer.captions_to_text()
        self.assertTrue(content is not None)
        self.assertTrue(content.startswith(u'<tt'))
        self.assertTrue(
            u"""<p begin="00:00:03" end="00:00:05">My first caption</p>""" in
            content)
Ejemplo n.º 3
0
 def setUp(self):
     self.writer = Writer(StringIO())
Ejemplo n.º 4
0
 def setUp(self):
     self.writer = Writer(StringIO())