projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credit @terminalmage for patreon (#3390)
[youtube-dl]
/
test
/
test_YoutubeDL.py
diff --git
a/test/test_YoutubeDL.py
b/test/test_YoutubeDL.py
index 2902dbec7326569d20cc99c9c17fce38bca1895a..e794cc97f0e643c5f05539fd3d0313d30dc98f8d 100644
(file)
--- a/
test/test_YoutubeDL.py
+++ b/
test/test_YoutubeDL.py
@@
-8,7
+8,7
@@
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from test.helper import FakeYDL
+from test.helper import FakeYDL
, assertRegexpMatches
from youtube_dl import YoutubeDL
from youtube_dl.extractor import YoutubeIE
from youtube_dl import YoutubeDL
from youtube_dl.extractor import YoutubeIE
@@
-67,7
+67,7
@@
class TestFormatSelection(unittest.TestCase):
downloaded = ydl.downloaded_info_dicts[0]
self.assertEqual(downloaded['ext'], 'mp4')
downloaded = ydl.downloaded_info_dicts[0]
self.assertEqual(downloaded['ext'], 'mp4')
- # No prefer_free_formats => prefer mp4 and flv for greater compatibilty
+ # No prefer_free_formats => prefer mp4 and flv for greater compatibil
i
ty
ydl = YDL()
ydl.params['prefer_free_formats'] = False
formats = [
ydl = YDL()
ydl.params['prefer_free_formats'] = False
formats = [
@@
-274,6
+274,12
@@
class TestFormatSelection(unittest.TestCase):
# Replace missing fields with 'NA'
self.assertEqual(fname('%(uploader_date)s-%(id)s.%(ext)s'), 'NA-1234.mp4')
# Replace missing fields with 'NA'
self.assertEqual(fname('%(uploader_date)s-%(id)s.%(ext)s'), 'NA-1234.mp4')
+ def test_format_note(self):
+ ydl = YoutubeDL()
+ self.assertEqual(ydl._format_note({}), '')
+ assertRegexpMatches(self, ydl._format_note({
+ 'vbr': 10,
+ }), '^\s*10k$')
if __name__ == '__main__':
unittest.main()
if __name__ == '__main__':
unittest.main()