예제 #1
0
 def test_junk_after_timestamp(self):
     item = WebVTTItem.from_string(self.junk_after_timestamp)
     self.assertEquals(item, self.item)
예제 #2
0
 def test_string_index(self):
     item = WebVTTItem.from_string(self.string_index)
     self.assertEquals(item.index, 'foo')
     self.assertEquals(item.text, 'Hello !')
예제 #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 !')
예제 #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:])
예제 #5
0
 def test_dots(self):
     self.assertEqual(WebVTTItem.from_string(self.dots), self.item)
예제 #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')
예제 #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 !')
예제 #8
0
 def test_junk_after_timestamp(self):
     item = WebVTTItem.from_string(self.junk_after_timestamp)
     self.assertEquals(item, self.item)
예제 #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)
예제 #10
0
 def test_string_index(self):
     item = WebVTTItem.from_string(self.string_index)
     self.assertEquals(item.index, 'foo')
     self.assertEquals(item.text, 'Hello !')
예제 #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 !')
예제 #12
0
 def test_dots(self):
     self.assertEqual(WebVTTItem.from_string(self.dots), self.item)
예제 #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:])
예제 #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 !')
예제 #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')
예제 #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)