mirror of
https://github.com/LucBerge/yt-dlp.git
synced 2025-03-17 19:57:52 +03:00
Simplify simplify_title
This commit is contained in:
parent
e33e3045c6
commit
e092418d8b
3 changed files with 47 additions and 114 deletions
|
@ -8,14 +8,21 @@ sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
|||
import youtube_dl
|
||||
|
||||
def test_simplify_title():
|
||||
assert youtube_dl._simplify_title('abc') == 'abc'
|
||||
assert youtube_dl._simplify_title('abc_d-e') == 'abc_d-e'
|
||||
assert youtube_dl._simplify_title(u'abc') == u'abc'
|
||||
assert youtube_dl._simplify_title(u'abc_d-e') == u'abc_d-e'
|
||||
|
||||
assert '/' not in youtube_dl._simplify_title('abc/de')
|
||||
assert 'abc' in youtube_dl._simplify_title('abc/de')
|
||||
assert 'de' in youtube_dl._simplify_title('abc/de')
|
||||
assert youtube_dl._simplify_title(u'123') == u'123'
|
||||
|
||||
assert '\\' not in youtube_dl._simplify_title('abc\\de')
|
||||
assert 'abc' in youtube_dl._simplify_title('abc\\de')
|
||||
assert 'de' in youtube_dl._simplify_title('abc\\de')
|
||||
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')
|
||||
|
||||
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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue