From de0ccfebb75f903634b62d608758cfd29e66add5 Mon Sep 17 00:00:00 2001 From: "Christopher K. Hoadley" Date: Thu, 2 Jan 2020 06:03:41 -0600 Subject: [PATCH] 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. --- sherlock/tests/base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sherlock/tests/base.py b/sherlock/tests/base.py index a749f53..3b4b180 100644 --- a/sherlock/tests/base.py +++ b/sherlock/tests/base.py @@ -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)