1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00

[test:devalue] improve revivers test

Authored by: bashonly
This commit is contained in:
bashonly 2025-06-11 10:23:16 -05:00
parent f93700421e
commit f125987349
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0

View File

@ -8,6 +8,7 @@
import datetime as dt
import json
import math
import re
import unittest
@ -222,8 +223,12 @@ def test_devalue_parse_cyclical(self):
def test_devalue_parse_revivers(self):
self.assertEqual(
devalue.parse([['Custom', 1], {'a': 2}, 'b'], revivers={'Custom': lambda x: x}),
{'a': 'b'}, 'revivers')
devalue.parse([['indirect', 1], {'a': 2}, 'b'], revivers={'indirect': lambda x: x}),
{'a': 'b'}, 'revivers (indirect)')
self.assertEqual(
devalue.parse([['parse', 1], '{"a":0}'], revivers={'parse': lambda x: json.loads(x)}),
{'a': 0}, 'revivers (parse)')
if __name__ == '__main__':