|
|
@ -16,6 +16,7 @@ from youtube_dl.utils import (
|
|
|
|
DateRange,
|
|
|
|
DateRange,
|
|
|
|
encodeFilename,
|
|
|
|
encodeFilename,
|
|
|
|
find_xpath_attr,
|
|
|
|
find_xpath_attr,
|
|
|
|
|
|
|
|
fix_xml_ampersands,
|
|
|
|
get_meta_content,
|
|
|
|
get_meta_content,
|
|
|
|
orderedSet,
|
|
|
|
orderedSet,
|
|
|
|
parse_duration,
|
|
|
|
parse_duration,
|
|
|
@ -200,5 +201,18 @@ class TestUtil(unittest.TestCase):
|
|
|
|
self.assertEqual(parse_duration('9:12:43'), 33163)
|
|
|
|
self.assertEqual(parse_duration('9:12:43'), 33163)
|
|
|
|
self.assertEqual(parse_duration('x:y'), None)
|
|
|
|
self.assertEqual(parse_duration('x:y'), None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_fix_xml_ampersands(self):
|
|
|
|
|
|
|
|
self.assertEqual(
|
|
|
|
|
|
|
|
fix_xml_ampersands('"&x=y&z=a'), '"&x=y&z=a')
|
|
|
|
|
|
|
|
self.assertEqual(
|
|
|
|
|
|
|
|
fix_xml_ampersands('"&x=y&wrong;&z=a'),
|
|
|
|
|
|
|
|
'"&x=y&wrong;&z=a')
|
|
|
|
|
|
|
|
self.assertEqual(
|
|
|
|
|
|
|
|
fix_xml_ampersands('&'><"'),
|
|
|
|
|
|
|
|
'&'><"')
|
|
|
|
|
|
|
|
self.assertEqual(
|
|
|
|
|
|
|
|
fix_xml_ampersands('Ӓ᪼'), 'Ӓ᪼')
|
|
|
|
|
|
|
|
self.assertEqual(fix_xml_ampersands('&#&#'), '&#&#')
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|
|
|
|
unittest.main()
|
|
|
|