mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-26 04:32:51 +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):
|
def run_test(self, extr, url, result):
|
||||||
hjob = job.HashJob(url, "content" in result)
|
hjob = job.HashJob(url, "content" in result)
|
||||||
self.assertEqual(extr, hjob.extractor.__class__)
|
self.assertEqual(extr, hjob.extractor.__class__)
|
||||||
|
if "exception" in result:
|
||||||
|
self.assertRaises(result["exception"], hjob.run)
|
||||||
|
return
|
||||||
hjob.run()
|
hjob.run()
|
||||||
if "url" in result:
|
if "url" in result:
|
||||||
self.assertEqual(hjob.hash_url.hexdigest(), result["url"])
|
self.assertEqual(hjob.hash_url.hexdigest(), result["url"])
|
||||||
|
Loading…
Reference in New Issue
Block a user