aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-15 15:10:24 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-09-15 15:10:24 +0200
commita020a0dc20ced6468ec46214c394f6f360735b1d (patch)
treef37221707ea88f2cbb0d3325f76658369148b65a /test
parentb04c8f735805ea2671429ac8d683c2887a6b4db8 (diff)
[facebook] Fix support for untitled videos (Fixes #3757)
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 8d8997977..70050d2b8 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -40,6 +40,7 @@ from youtube_dl.utils import (
parse_iso8601,
strip_jsonp,
uppercase_escape,
+ limit_length,
)
@@ -286,5 +287,12 @@ class TestUtil(unittest.TestCase):
self.assertEqual(uppercase_escape('aä'), 'aä')
self.assertEqual(uppercase_escape('\\U0001d550'), '𝕐')
+ def test_limit_length(self):
+ self.assertEqual(limit_length(None, 12), None)
+ self.assertEqual(limit_length('foo', 12), 'foo')
+ self.assertTrue(
+ limit_length('foo bar baz asd', 12).startswith('foo bar'))
+ self.assertTrue('...' in limit_length('foo bar baz asd', 12))
+
if __name__ == '__main__':
unittest.main()