Test "deep check results" page

These are some basic tests -- let's see if this improves test
coverage, and by how much.
This commit is contained in:
Sajith Sasidharan 2020-07-11 07:59:28 -04:00
parent b49a3eaf3a
commit 6eba2fb2e6

View File

@ -345,6 +345,53 @@ class WebResultsRendering(unittest.TestCase):
self.failUnlessEqual(j["storage-index"], "") self.failUnlessEqual(j["storage-index"], "")
_got_lit_results(d) _got_lit_results(d)
def test_deep_check_renderer(self):
monitor = Monitor()
status = check_results.DeepCheckResults("")
monitor.set_status(status)
elem = web_check_results.DeepCheckResultsRendererElement(monitor)
doc = self.render_element(elem)
soup = BeautifulSoup(doc, 'html5lib')
assert_soup_has_favicon(self, soup)
assert_soup_has_tag_with_content(
self, soup, u"title",
u"Tahoe-LAFS - Deep Check Results"
)
assert_soup_has_tag_with_content(
self, soup, u"h1",
"Deep-Check Results for root SI="
)
assert_soup_has_tag_with_content(
self, soup, u"li",
u"Objects Checked: 0"
)
assert_soup_has_tag_with_content(
self, soup, u"li",
u"Objects Healthy: 0"
)
assert_soup_has_tag_with_content(
self, soup, u"li",
u"Objects Unhealthy: 0"
)
assert_soup_has_tag_with_content(
self, soup, u"li",
u"Objects Unrecoverable: 0"
)
assert_soup_has_tag_with_content(
self, soup, u"li",
u"Corrupt Shares: 0"
)
def test_deep_check_and_repair_renderer(self): def test_deep_check_and_repair_renderer(self):
monitor = Monitor() monitor = Monitor()
status = check_results.DeepCheckAndRepairResults("") status = check_results.DeepCheckAndRepairResults("")