Add test to ensure that all sites have test data. If they do not, then the person running the tests will be able to see the list of sites missing coverage.

pull/169/head
Christopher K. Hoadley 6 years ago
parent 419c62f675
commit d3f0bfd0fc

@ -202,3 +202,20 @@ class SherlockSiteCoverageTests(SherlockBaseTest):
self.detect_type_check("message", exist_check=True)
return
def test_coverage_total(self):
"""Test Site Coverage Is Total.
This test checks that all sites have test data available.
Keyword Arguments:
self -- This object.
Return Value:
N/A.
Will trigger an assert if we do not have total coverage.
"""
self.coverage_total_check()
return

@ -166,3 +166,29 @@ class SherlockBaseTest(unittest.TestCase):
)
return
def coverage_total_check(self):
"""Total Coverage Check.
Keyword Arguments:
self -- This object.
Return Value:
N/A.
Counts up all Sites with full test data available.
Will trigger an assert if any Site does not have test coverage.
"""
site_no_tests_list = []
for site, site_data in self.site_data_all.items():
if (
(site_data.get("username_claimed") is None) or
(site_data.get("username_unclaimed") is None)
):
# Test information not available on this site.
site_no_tests_list.append(site)
self.assertEqual("", ", ".join(site_no_tests_list))
return

Loading…
Cancel
Save