1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[tests] implement 'len:'

This commit is contained in:
Mike Fährmann 2023-10-17 19:23:48 +02:00
parent a1977a698e
commit 9bc5ad4784
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -201,6 +201,9 @@ class TestExtractorResults(unittest.TestCase):
self.assertEqual(str(value), test[3:], msg=key)
elif test.startswith("type:"):
self.assertEqual(type(value).__name__, test[5:], msg=key)
elif test.startswith("len:"):
self.assertIsInstance(value, (list, tuple), msg=key)
self.assertEqual(len(value), int(test[4:]), msg=key)
else:
self.assertEqual(value, test, msg=key)
else: