diff options
Diffstat (limited to 'test/helper.py')
-rw-r--r-- | test/helper.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/helper.py b/test/helper.py index b63a5c897..1070e0668 100644 --- a/test/helper.py +++ b/test/helper.py @@ -211,7 +211,7 @@ def sanitize_got_info_dict(got_dict): # Auto-generated 'autonumber', 'playlist', 'format_index', 'video_ext', 'audio_ext', 'duration_string', 'epoch', - 'fulltitle', 'extractor', 'extractor_key', 'filepath', 'infojson_filename', 'original_url', + 'fulltitle', 'extractor', 'extractor_key', 'filepath', 'infojson_filename', 'original_url', 'n_entries', # Only live_status needs to be checked 'is_live', 'was_live', @@ -220,10 +220,12 @@ def sanitize_got_info_dict(got_dict): IGNORED_PREFIXES = ('', 'playlist', 'requested', 'webpage') def sanitize(key, value): - if isinstance(value, str) and len(value) > 100: + if isinstance(value, str) and len(value) > 100 and key != 'thumbnail': 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 = { @@ -233,7 +235,7 @@ def sanitize_got_info_dict(got_dict): } # display_id may be generated from id - if test_info_dict.get('display_id') == test_info_dict['id']: + if test_info_dict.get('display_id') == test_info_dict.get('id'): test_info_dict.pop('display_id') return 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 = '' |