mirror of
https://github.com/sherlock-project/sherlock
synced 2024-11-27 14:20:37 +00:00
Add option to skip test if site returns error status (e.g. timeout connecting with site). This makes it easier to interpret the test results.
This commit is contained in:
parent
2c9fb4f295
commit
de0ccfebb7
1 changed files with 11 additions and 0 deletions
|
@ -53,6 +53,7 @@ class SherlockBaseTest(unittest.TestCase):
|
|||
self.tor=False
|
||||
self.unique_tor=False
|
||||
self.timeout=None
|
||||
self.skip_error_sites=True
|
||||
|
||||
return
|
||||
|
||||
|
@ -123,6 +124,16 @@ class SherlockBaseTest(unittest.TestCase):
|
|||
with self.subTest(f"Checking Username '{username}' "
|
||||
f"{check_type_text} on Site '{site}'"
|
||||
):
|
||||
if (
|
||||
(self.skip_error_sites == True) and
|
||||
(result['status'].status == QueryStatus.UNKNOWN)
|
||||
):
|
||||
#Some error connecting to site.
|
||||
self.skipTest(f"Skipping Username '{username}' "
|
||||
f"{check_type_text} on Site '{site}': "
|
||||
f"Site returned error status."
|
||||
)
|
||||
|
||||
self.assertEqual(result['status'].status,
|
||||
exist_result_desired)
|
||||
|
||||
|
|
Loading…
Reference in a new issue