diff options
Diffstat (limited to 'test/test_results.py')
| -rw-r--r-- | test/test_results.py | 39 |
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() |
