allow for simplified test data structures

Instead of a strict list of (URL, RESULTS)-tuples, extractor result
tests can now be a single (URL, RESULTS)-tuple, if it's just one test,
and "only matching" tests can now be a simple string.
This commit is contained in:
Mike Fährmann
2019-02-06 17:24:44 +01:00
parent b49c3c9991
commit bc0951d974
7 changed files with 26 additions and 12 deletions

View File

@@ -255,8 +255,9 @@ def main():
print(extr.__doc__)
print("Category:", extr.category,
"- Subcategory:", extr.subcategory)
if hasattr(extr, "test") and extr.test:
print("Example :", extr.test[0][0])
test = next(extr._get_tests(), None)
if test:
print("Example :", test[0])
print()
else:
if not args.urls and not args.inputfile: