def shouldTallyPageCounts(self): accum = Counts() assert not accum.isSummaryCount() ex1 = Counts("1 right, 0 wrong, 15 ignored, 8 exceptions") accum.tallyPageCounts(ex1) assert accum.isSummaryCount() assert str(accum) == "0 right, 0 wrong, 0 ignored, 1 exceptions" ex2 = Counts("1 right, 0 wrong, 15 ignored, 0 exceptions") accum.tallyPageCounts(ex2) assert str(accum) == "1 right, 0 wrong, 0 ignored, 1 exceptions" ex3 = Counts("0 right, 0 wrong, 15 ignored, 0 exceptions") accum.tallyPageCounts(ex3) assert str(accum) == "1 right, 0 wrong, 1 ignored, 1 exceptions" ex4 = Counts("5 right, 1 wrong, 15 ignored, 0 exceptions") accum.tallyPageCounts(ex4) assert str(accum) == "1 right, 1 wrong, 1 ignored, 1 exceptions"
def shouldTakeStringConstructor(self): count = Counts("1 right, 0 wrong, 15 ignored, 8 exceptions") assert str(count) == "1 right, 0 wrong, 15 ignored, 8 exceptions" assert str(count) == count.toString() # depreciated! assert count.totalCounts() == 24 assert count.isError() assert count.numErrors() == 8 assert not count.isSummaryCount()