diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-11-23 10:49:19 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-11-23 10:51:09 +0100 |
commit | 7d4111ed14848c3e72d55d47f11cd7e9fadea403 (patch) | |
tree | fd583582ca5caf291a12a18a9f9cb3fc61b1b1f8 /test | |
parent | d37cab2a9d1da8056460613007f3099e7a9d8f7e (diff) |
Provide guidance when called with a YouTube ID starting with a dash.
Reported at https://news.ycombinator.com/item?id=8648121
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 0fa873147..9a62322f0 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -47,6 +47,7 @@ from youtube_dl.utils import ( js_to_json, get_filesystem_encoding, intlist_to_bytes, + args_to_str, ) @@ -361,5 +362,11 @@ class TestUtil(unittest.TestCase): intlist_to_bytes([0, 1, 127, 128, 255]), b'\x00\x01\x7f\x80\xff') + def test_args_to_str(self): + self.assertEqual( + args_to_str(['foo', 'ba/r', '-baz', '2 be', '']), + 'foo ba/r -baz \'2 be\' \'\'' + ) + if __name__ == '__main__': unittest.main() |