mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
support expecting exceptions in tests
This commit is contained in:
parent
efdc299547
commit
2c9bc50c23
@ -19,6 +19,9 @@ class TestExtractors(unittest.TestCase):
|
||||
def run_test(self, extr, url, result):
|
||||
hjob = job.HashJob(url, "content" in result)
|
||||
self.assertEqual(extr, hjob.extractor.__class__)
|
||||
if "exception" in result:
|
||||
self.assertRaises(result["exception"], hjob.run)
|
||||
return
|
||||
hjob.run()
|
||||
if "url" in result:
|
||||
self.assertEqual(hjob.hash_url.hexdigest(), result["url"])
|
||||
|
Loading…
Reference in New Issue
Block a user