mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
allow testing metadata in list elements
This commit is contained in:
parent
c67756e187
commit
af6424f398
@ -262,13 +262,13 @@ class KemonopartyPostExtractor(KemonopartyExtractor):
|
||||
"count": 2,
|
||||
}),
|
||||
# DMs (#2008)
|
||||
("https://kemono.party/patreon/user/34134344/post/52245464", {
|
||||
("https://kemono.party/patreon/user/34134344/post/38129255", {
|
||||
"options": (("dms", True),),
|
||||
"keyword": {"dms": [{
|
||||
"body": r"re:Hi! Thank you very much for supporting the work I"
|
||||
r" did in May. Here's your reward pack! I hope you fin"
|
||||
r"d something you enjoy in it. :)\n\nhttps://www.media"
|
||||
r"fire.com/file/\w+/Set13_tier_2.zip/file",
|
||||
r"d something you enjoy in it. :\)\n\nhttps://www.medi"
|
||||
r"afire.com/file/\w+/Set13_tier_2.zip/file",
|
||||
"date": "2021-07-31 02:47:51.327865",
|
||||
}]},
|
||||
}),
|
||||
|
@ -148,6 +148,14 @@ class TestExtractorResults(unittest.TestCase):
|
||||
self._test_kwdict(value, test)
|
||||
elif isinstance(test, type):
|
||||
self.assertIsInstance(value, test, msg=key)
|
||||
elif isinstance(test, list):
|
||||
subtest = False
|
||||
for idx, item in enumerate(test):
|
||||
if isinstance(item, dict):
|
||||
subtest = True
|
||||
self._test_kwdict(value[idx], item)
|
||||
if not subtest:
|
||||
self.assertEqual(value, test, msg=key)
|
||||
elif isinstance(test, str):
|
||||
if test.startswith("re:"):
|
||||
self.assertRegex(value, test[3:], msg=key)
|
||||
|
Loading…
Reference in New Issue
Block a user