summaryrefslogtreecommitdiffstats
path: root/test/test_results.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-06-06 02:40:15 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2024-06-06 02:40:15 -0400
commit1c28712d865e30ed752988ba0b6944882250b665 (patch)
treee5d5083a418f5c19616cb940c090c2dfb646d3cb /test/test_results.py
parent6e662211019a89caec44de8a57c675872b0b5498 (diff)
New upstream version 1.27.0.upstream/1.27.0
Diffstat (limited to 'test/test_results.py')
-rw-r--r--test/test_results.py39
1 files changed, 23 insertions, 16 deletions
diff --git a/test/test_results.py b/test/test_results.py
index 0594618..aaa71ec 100644
--- a/test/test_results.py
+++ b/test/test_results.py
@@ -54,6 +54,7 @@ AUTH_CONFIG = (
"cookies",
"api-key",
"client-id",
+ "access-token",
"refresh-token",
)
@@ -88,6 +89,19 @@ class TestExtractorResults(unittest.TestCase):
result.pop("#comment", None)
only_matching = (len(result) <= 3)
+ 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 AUTH_CONFIG):
+ self._skipped.append((result["#url"], "no auth"))
+ only_matching = True
+
if only_matching:
content = False
else:
@@ -95,21 +109,6 @@ class TestExtractorResults(unittest.TestCase):
for key, value in result["#options"].items():
key = key.split(".")
config.set(key[:-1], key[-1], value)
-
- 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 AUTH_CONFIG):
- msg = "no auth"
- self._skipped.append((result["#url"], msg))
- self.skipTest(msg)
-
if "#range" in result:
config.set((), "image-range" , result["#range"])
config.set((), "chapter-range", result["#range"])
@@ -442,7 +441,15 @@ def generate_tests():
tests = results.category(category)
if subcategory:
- tests = [t for t in tests if t["#category"][-1] == subcategory]
+ if subcategory.startswith("+"):
+ url = subcategory[1:]
+ tests = [t for t in tests if url in t["#url"]]
+ elif subcategory.startswith("~"):
+ com = subcategory[1:]
+ tests = [t for t in tests
+ if "#comment" in t and com in t["#comment"].lower()]
+ else:
+ tests = [t for t in tests if t["#category"][-1] == subcategory]
else:
tests = results.all()