class TestSummary(TestCase): def setUp(self): print '%s %s' % (self.id(), self.shortDescription()) self.sum = Summary() ## def tearDown(self): ## pass def doIt(self): self.table = Parse("<table><tr><td>fit.Summary</td></tr></table>") self.sum.doTable(self.table) return self.table.parts.more def shouldOnlyHaveCountsLineForEmptySummary(self): sumObj = self.sum row = self.doIt() assert row.more is None assert row.parts.body.find("counts") > 0 assert row.parts.more.tagIsRight() assert sumObj.counts.totalCounts() == 0 def shouldPutOutTheSummaryDictionaryInOrder(self): sumObj = self.sum sumObj.summary["alpha"] = "last" sumObj.summary["omega"] = "first" row = self.doIt() assert row.more.parts.body.find("counts") > 0 assert row.more.parts.more.tagIsRight() assert row.more.more.more is None def shouldAnnotateCountAsWrongIfErrors(self): sumObj = self.sum sumObj.counts.exceptions += 1 row = self.doIt() assert row.more is None assert row.parts.body.find("counts") > 0 assert row.parts.more.tagIsWrong() assert sumObj.counts.totalCounts() == 1
def setUp(self): print '%s %s' % (self.id(), self.shortDescription()) self.sum = Summary()
def showSummary(self): return Summary()