1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[tests] ensure 'extractor.find' and 'from_url' extractors are identical

This commit is contained in:
Mike Fährmann 2024-09-22 10:57:18 +02:00
parent 14c57f771c
commit 933dc568c3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -97,10 +97,12 @@ class TestExtractorResults(unittest.TestCase):
result.pop("#category", None)
auth = result.pop("#auth", None)
extractor.find(result["#url"])
extr = result["#class"].from_url(result["#url"])
if not extr:
raise exception.NoExtractorError()
extr_url = extractor.find(result["#url"])
self.assertTrue(extr_url, "extractor by URL/find")
extr_cls = extr = result["#class"].from_url(result["#url"])
self.assertTrue(extr_url, "extractor by cls.from_url()")
self.assertIs(extr_url.__class__, extr_cls.__class__)
if len(result) <= 2:
return # only matching