From 933dc568c34ad0cc3115f15dedf413b82ae858f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 22 Sep 2024 10:57:18 +0200 Subject: [PATCH] [tests] ensure 'extractor.find' and 'from_url' extractors are identical --- test/test_results.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_results.py b/test/test_results.py index e5044c5e..aa09f2fd 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -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