diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2012-11-27 15:07:10 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2012-11-27 15:07:10 +0100 |
commit | 46cbda0be4bed00122a5cf43e640808e6c32222d (patch) | |
tree | ddb5c4ad471bc7e593edfb4cb87ab8c3622a217a /test | |
parent | fa59f4b6a9df03d1156dd2d274295a7b3d75c059 (diff) |
Minor filename encoding improvement in a common case
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 4208ee653..e806a10c5 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -61,6 +61,13 @@ class TestUtil(unittest.TestCase): for fbc in forbidden: self.assertTrue(fbc not in sanitize_filename(fc, restricted=True)) + # Handle a common case more neatly + self.assertEqual(sanitize_filename(u'大声带 - Song', restricted=True), u'Song') + self.assertEqual(sanitize_filename(u'总统: Speech', restricted=True), u'Speech') + # .. but make sure the file name is never empty + self.assertTrue(sanitize_filename(u'-', restricted=True) != u'') + self.assertTrue(sanitize_filename(u':', restricted=True) != u'') + def test_ordered_set(self): self.assertEqual(orderedSet([1,1,2,3,4,4,5,6,7,3,5]), [1,2,3,4,5,6,7]) self.assertEqual(orderedSet([]), []) |