mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-09-05 15:47:29 +00:00
[utils] subs_list_to_dict: Fix empty value handling (#17311)
Authored by: doe1080
This commit is contained in:
@@ -546,6 +546,18 @@ class TestTraversalHelpers:
|
||||
{'url': 'https://example.com/subs/de4'},
|
||||
],
|
||||
}, 'non str types should be replaced by default id'
|
||||
assert traverse_obj([
|
||||
{'name': '', 'ext': '', 'url': 'https://example.com/subs/en'},
|
||||
], [..., {
|
||||
'id': 'name',
|
||||
'ext': 'ext',
|
||||
'url': 'url',
|
||||
}, all, {subs_list_to_dict(lang='en', ext='vtt')}]) == {
|
||||
'en': [{
|
||||
'ext': 'vtt',
|
||||
'url': 'https://example.com/subs/en',
|
||||
}],
|
||||
}, 'empty id and ext should be replaced by defaults'
|
||||
|
||||
def test_trim_str(self):
|
||||
with pytest.raises(TypeError):
|
||||
|
||||
Reference in New Issue
Block a user