aboutsummaryrefslogtreecommitdiff
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-02-25 01:43:17 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-02-25 01:43:17 +0100
commit62e609ab771140b185e98ed085445d40b751cbfc (patch)
tree9daee9760c5d77d8acc9bdef877ac8fbbeb07488 /test/test_utils.py
parentf6acbdecf483513166287a41cba5eed928404dc2 (diff)
downloadyoutube-dl-62e609ab771140b185e98ed085445d40b751cbfc.tar.xz
Ignore BOM in batch files (Fixes #2450)
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 84553b943..4e3c37fb4 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -9,6 +9,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Various small unit tests
+import io
import xml.etree.ElementTree
#from youtube_dl.utils import htmlentity_transform
@@ -21,6 +22,7 @@ from youtube_dl.utils import (
orderedSet,
PagedList,
parse_duration,
+ read_batch_urls,
sanitize_filename,
shell_quote,
smuggle_url,
@@ -250,5 +252,14 @@ class TestUtil(unittest.TestCase):
def test_struct_unpack(self):
self.assertEqual(struct_unpack(u'!B', b'\x00'), (0,))
+ def test_read_batch_urls(self):
+ f = io.StringIO(u'''\xef\xbb\xbf foo
+ bar\r
+ baz
+ # More after this line\r
+ ; or after this
+ bam''')
+ self.assertEqual(read_batch_urls(f), [u'foo', u'bar', u'baz', u'bam'])
+
if __name__ == '__main__':
unittest.main()