diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-09-15 15:10:24 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-09-15 15:10:24 +0200 |
commit | a020a0dc20ced6468ec46214c394f6f360735b1d (patch) | |
tree | f37221707ea88f2cbb0d3325f76658369148b65a /test | |
parent | b04c8f735805ea2671429ac8d683c2887a6b4db8 (diff) |
[facebook] Fix support for untitled videos (Fixes #3757)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 8 |
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() |