[facebook] Fix support for untitled videos (Fixes #3757)
This commit is contained in:
parent
b04c8f7358
commit
a020a0dc20
3 changed files with 28 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue