aboutsummaryrefslogtreecommitdiff
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-08 22:08:48 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-08 22:08:48 +0600
commitf18ef2d14463a13d80e967d1b18ece6a076f60fa (patch)
tree0516a7bee703a243dc33fea502c4dbf7c8ca43b1 /test/test_utils.py
parent1bb5c511a551ba7c5d3179d2d3a124f0977e74b4 (diff)
[utils] Disallow trailing dot in sanitize_path for a path part
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 5ebb8d498..28bda654e 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -152,6 +152,17 @@ class TestUtil(unittest.TestCase):
self.assertEqual(sanitize_path('\\\\?\\C:\\ab?c\\de:f'), '\\\\?\\C:\\ab#c\\de#f')
self.assertEqual(sanitize_path('\\\\?\\C:\\abc'), '\\\\?\\C:\\abc')
+ self.assertEqual(
+ sanitize_path('youtube/%(uploader)s/%(autonumber)s-%(title)s-%(upload_date)s.%(ext)s'),
+ 'youtube\\%(uploader)s\\%(autonumber)s-%(title)s-%(upload_date)s.%(ext)s')
+
+ self.assertEqual(
+ sanitize_path('youtube/TheWreckingYard ./00001-Not bad, Especially for Free! (1987 Yamaha 700)-20141116.mp4.part'),
+ 'youtube\\TheWreckingYard #\\00001-Not bad, Especially for Free! (1987 Yamaha 700)-20141116.mp4.part')
+ self.assertEqual(sanitize_path('abc/def...'), 'abc\\def..#')
+ self.assertEqual(sanitize_path('abc.../def'), 'abc..#\\def')
+ self.assertEqual(sanitize_path('abc.../def...'), 'abc..#\\def..#')
+
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([]), [])