diff options
| author | 2024-02-20 02:31:16 -0500 | |
|---|---|---|
| committer | 2024-02-20 02:31:16 -0500 | |
| commit | 684fd7519617739230d5359886c36b2fe6c4ab41 (patch) | |
| tree | 1aa2e9b5bd417ace84fc61450534eedd2c2ff9e8 /test | |
| parent | a2409defe80fb91974e53cccdc8efcd89ce9ed09 (diff) | |
| parent | 01166fa52707cc282467427cf0e65c1b8983c4be (diff) | |
Update upstream source from tag 'upstream/1.26.8'
Update to upstream version '1.26.8'
with Debian dir 482971a2b2c7f6d606afeac49d14a5f002e4ba09
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_results.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/test/test_results.py b/test/test_results.py index 680b0f9..bceb271 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -49,6 +49,14 @@ AUTH = { "twitter", } +AUTH_CONFIG = ( + "username", + "cookies", + "api-key", + "client-id", + "refresh-token", +) + class TestExtractorResults(unittest.TestCase): @@ -88,14 +96,16 @@ class TestExtractorResults(unittest.TestCase): key = key.split(".") config.set(key[:-1], key[-1], value) - requires_auth = result.get("#auth") - if requires_auth is None: - requires_auth = (result["#category"][1] in AUTH) - if requires_auth: + auth = result.get("#auth") + if auth is None: + auth = (result["#category"][1] in AUTH) + elif not auth: + for key in AUTH_CONFIG: + config.set((), key, None) + + if auth: extr = result["#class"].from_url(result["#url"]) - if not any(extr.config(key) for key in ( - "username", "cookies", "api-key", "client-id", - "refresh-token")): + if not any(extr.config(key) for key in AUTH_CONFIG): msg = "no auth" self._skipped.append((result["#url"], msg)) self.skipTest(msg) |
