diff --git a/src/allmydata/test/test_checker.py b/src/allmydata/test/test_checker.py index 49d38b88c..0cdee2aa8 100644 --- a/src/allmydata/test/test_checker.py +++ b/src/allmydata/test/test_checker.py @@ -20,6 +20,7 @@ from allmydata.interfaces import ( IServer, ICheckResults, IDeepCheckResults, + ICheckAndRepairResults, ) from allmydata.util import base32 from allmydata.web import check_results as web_check_results @@ -126,6 +127,25 @@ class FakeDeepCheckResults(object): return { FakeResults().get_corrupt_shares() } +@implementer(ICheckAndRepairResults) +class FakeDeepCheckAndRepairResults(object): + + def get_storage_index(self): + return "" + + def get_pre_repair_results(self): + return FakeResults() + + def get_post_repair_results(self): + return FakeResults() + + def get_repair_attempted(self): + return True + + def get_repair_successful(self): + return False + + class WebResultsRendering(unittest.TestCase): def remove_tags(self, s): @@ -495,8 +515,15 @@ class WebResultsRendering(unittest.TestCase): def test_deep_check_and_repair_renderer(self): monitor = Monitor() + status = check_results.DeepCheckAndRepairResults("") + status.add_check_and_repair( + FakeDeepCheckAndRepairResults(), + (u"some", u"fake", u"path") + ) + monitor.set_status(status) + elem = web_check_results.DeepCheckAndRepairResultsRendererElement(monitor) doc = self.render_element(elem) soup = BeautifulSoup(doc, 'html5lib')