]> Raphaël G. Git Repositories - youtubedl/blob - test/test_div.py
Disable downloading from tube.majestyc.net for the moment.
[youtubedl] / test / test_div.py
1 # -*- coding: utf-8 -*-
2
3 # Various small unit tests
4
5 import os,sys
6 sys.path.append(os.path.dirname(os.path.dirname(__file__)))
7
8 import youtube_dl
9
10 def test_simplify_title():
11 assert youtube_dl._simplify_title(u'abc') == u'abc'
12 assert youtube_dl._simplify_title(u'abc_d-e') == u'abc_d-e'
13
14 assert youtube_dl._simplify_title(u'123') == u'123'
15
16 assert u'/' not in youtube_dl._simplify_title(u'abc/de')
17 assert u'abc' in youtube_dl._simplify_title(u'abc/de')
18 assert u'de' in youtube_dl._simplify_title(u'abc/de')
19 assert u'/' not in youtube_dl._simplify_title(u'abc/de///')
20
21 assert u'\\' not in youtube_dl._simplify_title(u'abc\\de')
22 assert u'abc' in youtube_dl._simplify_title(u'abc\\de')
23 assert u'de' in youtube_dl._simplify_title(u'abc\\de')
24
25 assert youtube_dl._simplify_title(u'ä') == u'ä'
26 assert youtube_dl._simplify_title(u'кириллица') == u'кириллица'
27
28 # Strip underlines
29 assert youtube_dl._simplify_title(u'\'a_') == u'a'