From e33e3045c6d3a4e6a8489074548e392e4f748615 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 21 Nov 2011 20:07:24 +0100 Subject: First tests --- test/test_div.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/test_div.py (limited to 'test') diff --git a/test/test_div.py b/test/test_div.py new file mode 100644 index 000000000..367780ed3 --- /dev/null +++ b/test/test_div.py @@ -0,0 +1,21 @@ +# -*- 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(): + assert youtube_dl._simplify_title('abc') == 'abc' + assert youtube_dl._simplify_title('abc_d-e') == '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 '\\' 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') + -- cgit v1.2.3