Exemple #1
0
 def test_junk_after_timestamp(self):
     item = WebVTTItem.from_string(self.junk_after_timestamp)
     self.assertEquals(item, self.item)
Exemple #2
0
 def test_string_index(self):
     item = WebVTTItem.from_string(self.string_index)
     self.assertEquals(item.index, 'foo')
     self.assertEquals(item.text, 'Hello !')
Exemple #3
0
 def test_no_index(self):
     item = WebVTTItem.from_string(self.no_index)
     self.assertEquals(item.index, None)
     self.assertEquals(item.text, 'Hello world !')
Exemple #4
0
 def test_idempotence(self):
     vtt = WebVTTItem.from_string(self.vtt)
     self.assertEqual(str(vtt), self.vtt)
     item = WebVTTItem.from_string(self.coordinates)
     self.assertEqual(str(item), self.coordinates[2:])
Exemple #5
0
 def test_dots(self):
     self.assertEqual(WebVTTItem.from_string(self.dots), self.item)
Exemple #6
0
 def test_coordinates(self):
     item = WebVTTItem.from_string(self.coordinates)
     self.assertEqual(item, self.item)
     self.assertEqual(item.position, 'X1:000 X2:000 Y1:050 Y2:100')
Exemple #7
0
 def test_vtt_positioning(self):
     vtt = WebVTTItem.from_string(self.vtt)
     self.assertEqual(vtt.position, 'D:vertical A:start L:12%')
     self.assertEqual(vtt.index, None)
     self.assertEqual(vtt.text, 'Hello world !')
Exemple #8
0
 def test_junk_after_timestamp(self):
     item = WebVTTItem.from_string(self.junk_after_timestamp)
     self.assertEquals(item, self.item)
Exemple #9
0
 def test_from_string(self):
     self.assertEqual(WebVTTItem.from_string(self.string), self.item)
     self.assertRaises(InvalidItem, WebVTTItem.from_string, self.bad_string)
Exemple #10
0
 def test_string_index(self):
     item = WebVTTItem.from_string(self.string_index)
     self.assertEquals(item.index, 'foo')
     self.assertEquals(item.text, 'Hello !')
Exemple #11
0
 def test_no_index(self):
     item = WebVTTItem.from_string(self.no_index)
     self.assertEquals(item.index, None)
     self.assertEquals(item.text, 'Hello world !')
Exemple #12
0
 def test_dots(self):
     self.assertEqual(WebVTTItem.from_string(self.dots), self.item)
Exemple #13
0
 def test_idempotence(self):
     vtt = WebVTTItem.from_string(self.vtt)
     self.assertEqual(str(vtt), self.vtt)
     item = WebVTTItem.from_string(self.coordinates)
     self.assertEqual(str(item), self.coordinates[2:])
Exemple #14
0
 def test_vtt_positioning(self):
     vtt = WebVTTItem.from_string(self.vtt)
     self.assertEqual(vtt.position, 'D:vertical A:start L:12%')
     self.assertEqual(vtt.index, None)
     self.assertEqual(vtt.text, 'Hello world !')
Exemple #15
0
 def test_coordinates(self):
     item = WebVTTItem.from_string(self.coordinates)
     self.assertEqual(item, self.item)
     self.assertEqual(item.position, 'X1:000 X2:000 Y1:050 Y2:100')
Exemple #16
0
 def test_from_string(self):
     self.assertEqual(WebVTTItem.from_string(self.string), self.item)
     self.assertRaises(InvalidItem, WebVTTItem.from_string,
                       self.bad_string)