Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
 def setUp(self):
     print '%s %s' % (self.id(), self.shortDescription())
     self.sum = Summary()
Beispiel #4
0
 def showSummary(self):
     return Summary()
Beispiel #5
0
 def setUp(self):
     print '%s %s' % (self.id(), self.shortDescription())
     self.sum = Summary()