1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-27 06:05:34 +08:00
youtube-dl/test/test_div.py

29 lines
830 B
Python
Raw Normal View History

2011-11-22 03:07:24 +08:00
# -*- coding: utf-8 -*-
# Various small unit tests
import os,sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import youtube_dl
def test_simplify_title():
2011-11-22 03:15:32 +08:00
assert youtube_dl._simplify_title(u'abc') == u'abc'
assert youtube_dl._simplify_title(u'abc_d-e') == u'abc_d-e'
2011-11-22 03:07:24 +08:00
2011-11-22 03:15:32 +08:00
assert youtube_dl._simplify_title(u'123') == u'123'
2011-11-22 03:07:24 +08:00
2011-11-22 03:15:32 +08:00
assert u'/' not in youtube_dl._simplify_title(u'abc/de')
assert u'abc' in youtube_dl._simplify_title(u'abc/de')
assert u'de' in youtube_dl._simplify_title(u'abc/de')
2011-11-22 03:07:24 +08:00
2011-11-22 03:15:32 +08:00
assert u'\\' not in youtube_dl._simplify_title(u'abc\\de')
assert u'abc' in youtube_dl._simplify_title(u'abc\\de')
assert u'de' in youtube_dl._simplify_title(u'abc\\de')
# TODO: Fix #220
#assert youtube_dl._simplify_title(u'ä') == u'ä'
# Strip underlines
assert youtube_dl._simplify_title(u'\'a_') == u'a'