From e092418d8b360aaaf8c7eba67956010f4e363121 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 21 Nov 2011 20:15:32 +0100 Subject: Simplify simplify_title --- test/test_div.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/test_div.py b/test/test_div.py index 367780ed3..4525c8be6 100644 --- a/test/test_div.py +++ b/test/test_div.py @@ -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' -- cgit v1.2.3