1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-06-30 11:02:54 -05:00

[youtube] Update tests

This commit is contained in:
pukkandan
2022-01-07 17:24:57 +05:30
parent f0d785d3ed
commit 976ae3eabb
2 changed files with 511 additions and 30 deletions

View File

@ -224,6 +224,8 @@ def sanitize_got_info_dict(got_dict):
return f'md5:{md5(value)}'
elif isinstance(value, list) and len(value) > 10:
return f'count:{len(value)}'
elif key.endswith('_count') and isinstance(value, int):
return int
return value
test_info_dict = {
@ -259,6 +261,8 @@ def expect_info_dict(self, got_dict, expected_dict):
def _repr(v):
if isinstance(v, compat_str):
return "'%s'" % v.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n')
elif isinstance(v, type):
return v.__name__
else:
return repr(v)
info_dict_str = ''