summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2015-12-14 21:30:58 +0600
committerSergey M․ <[email protected]>2015-12-14 21:30:58 +0600
commit31b2051e211f3e2691a186d16733cf91eb4ab391 (patch)
treecc389d19f9138799eb749a9ad332f0ea2091fabd /test
parenteb0bdc2c3e112801bbc7517def25647b8a9fe4a4 (diff)
downloadyoutube-dl-31b2051e211f3e2691a186d16733cf91eb4ab391.tar.gz
youtube-dl-31b2051e211f3e2691a186d16733cf91eb4ab391.zip
[utils] Add remove_quotes
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 501355c74..8fc74e591 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -43,6 +43,7 @@ from youtube_dl.utils import (
sanitize_path,
prepend_extension,
replace_extension,
+ remove_quotes,
shell_quote,
smuggle_url,
str_to_int,
@@ -200,6 +201,15 @@ class TestUtil(unittest.TestCase):
self.assertEqual(replace_extension('.abc', 'temp'), '.abc.temp')
self.assertEqual(replace_extension('.abc.ext', 'temp'), '.abc.temp')
+ def test_remove_quotes(self):
+ self.assertEqual(remove_quotes(None), None)
+ self.assertEqual(remove_quotes('"'), '"')
+ self.assertEqual(remove_quotes("'"), "'")
+ self.assertEqual(remove_quotes(';'), ';')
+ self.assertEqual(remove_quotes('";'), '";')
+ self.assertEqual(remove_quotes('""'), '')
+ self.assertEqual(remove_quotes('";"'), ';')
+
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([]), [])