1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 01:02:48 +01:00

[test_download] Match info dicts against tests before matching info file

This commit is contained in:
Sergey M․ 2017-04-08 14:10:12 +07:00
parent 3bef10a50c
commit 80b2fdf9ac
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -200,8 +200,9 @@ def try_rm_tcs_files(tcs=None):
self.assertEqual( self.assertEqual(
test_case['playlist_duration_sum'], got_duration) test_case['playlist_duration_sum'], got_duration)
for tc in test_cases: for tc_num, tc in enumerate(test_cases):
expect_value(self, res_dict['id'], tc['info_dict']['id'], 'id') tc_res_dict = res_dict['entries'][tc_num] if is_playlist else res_dict
expect_info_dict(self, tc_res_dict, tc.get('info_dict', {}))
tc_filename = get_tc_filename(tc) tc_filename = get_tc_filename(tc)
if not test_case.get('params', {}).get('skip_download', False): if not test_case.get('params', {}).get('skip_download', False):
self.assertTrue(os.path.exists(tc_filename), msg='Missing file ' + tc_filename) self.assertTrue(os.path.exists(tc_filename), msg='Missing file ' + tc_filename)