Skip to content

Commit

Permalink
Add test to ensure that all sites have test data. If they do not, the…
Browse files Browse the repository at this point in the history
…n the person running the tests will be able to see the list of sites missing coverage.
  • Loading branch information
hoadlck committed Feb 10, 2019
1 parent 419c62f commit d3f0bfd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,20 @@ def test_coverage_true_via_message(self):
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
26 changes: 26 additions & 0 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,29 @@ def detect_type_check(self, detect_type, exist_check=True):
)

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

0 comments on commit d3f0bfd

Please sign in to comment.