Skip to content

Commit

Permalink
correction on the sanitize title method, change in title resulting
Browse files Browse the repository at this point in the history
  • Loading branch information
gcmalloc committed Oct 12, 2012
1 parent b387fb0 commit 9993976
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
29 changes: 0 additions & 29 deletions test/test_div.py

This file was deleted.

23 changes: 23 additions & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-

# Various small unit tests

from youtube_dl.utils import sanitize_filename

def test_sanitize_filename():
assert sanitize_filename(u'abc') == u'abc'
assert sanitize_filename(u'abc_d-e') == u'abc_d-e'

assert sanitize_filename(u'123') == u'123'

assert u'/' not in sanitize_filename(u'abc/de')
assert u'abc' in sanitize_filename(u'abc/de')
assert u'de' in sanitize_filename(u'abc/de')
assert u'/' not in sanitize_filename(u'abc/de///')

assert u'\\' not in sanitize_filename(u'abc\\de')
assert u'abc' in sanitize_filename(u'abc\\de')
assert u'de' in sanitize_filename(u'abc\\de')

assert sanitize_filename(u'ä') == u'ä'
assert sanitize_filename(u'кириллица') == u'кириллица'

0 comments on commit 9993976

Please sign in to comment.