mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-25 23:51:07 +00:00
Expand "deep check results" test
This commit is contained in:
parent
f547509332
commit
3c079bef73
@ -90,10 +90,11 @@ class FakeResults(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def get_summary(self):
|
def get_summary(self):
|
||||||
return "A fake summary"
|
return "fake summary results"
|
||||||
|
|
||||||
def get_corrupt_shares(self):
|
def get_corrupt_shares(self):
|
||||||
return (FakeServer(), None, None)
|
# Returns (IServer, storage_index, sharenum)
|
||||||
|
return (FakeServer(), "fake-si", 0)
|
||||||
|
|
||||||
|
|
||||||
# TODO: maybe use check_results.DeepCheckResults?
|
# TODO: maybe use check_results.DeepCheckResults?
|
||||||
@ -121,11 +122,8 @@ class FakeDeepCheckResults(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_corrupt_shares(self):
|
def get_corrupt_shares(self):
|
||||||
return [
|
# Returns a set of (IServer, storage_index, sharenum)
|
||||||
# TODO: fill this with:
|
return { FakeResults().get_corrupt_shares() }
|
||||||
# (IServer, storage_index, sharenum)
|
|
||||||
FakeResults().get_corrupt_shares(),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class WebResultsRendering(unittest.TestCase):
|
class WebResultsRendering(unittest.TestCase):
|
||||||
@ -430,7 +428,6 @@ class WebResultsRendering(unittest.TestCase):
|
|||||||
monitor.set_status(result)
|
monitor.set_status(result)
|
||||||
|
|
||||||
elem = web_check_results.DeepCheckResultsRendererElement(monitor)
|
elem = web_check_results.DeepCheckResultsRendererElement(monitor)
|
||||||
|
|
||||||
doc = self.render_element(elem)
|
doc = self.render_element(elem)
|
||||||
soup = BeautifulSoup(doc, 'html5lib')
|
soup = BeautifulSoup(doc, 'html5lib')
|
||||||
|
|
||||||
@ -471,6 +468,26 @@ class WebResultsRendering(unittest.TestCase):
|
|||||||
u"Corrupt Shares: 1"
|
u"Corrupt Shares: 1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert_soup_has_tag_with_content(
|
||||||
|
self, soup, u"h2",
|
||||||
|
u"Files/Directories That Had Problems:"
|
||||||
|
)
|
||||||
|
|
||||||
|
assert_soup_has_tag_with_content(
|
||||||
|
self, soup, u"h2",
|
||||||
|
u"Servers on which corrupt shares were found"
|
||||||
|
)
|
||||||
|
|
||||||
|
assert_soup_has_tag_with_content(
|
||||||
|
self, soup, u"h2",
|
||||||
|
u"Corrupt Shares"
|
||||||
|
)
|
||||||
|
|
||||||
|
assert_soup_has_tag_with_content(
|
||||||
|
self, soup, u"h2",
|
||||||
|
u"All Results"
|
||||||
|
)
|
||||||
|
|
||||||
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("")
|
||||||
|
Loading…
Reference in New Issue
Block a user