def test_count_4(self): self.assertEquals(15, IterTools.count(range(15)))
def test_count_3(self): self.assertEquals(1, IterTools.count(iter([1])))
def test_count_1(self): self.assertEquals(0, IterTools.count([]))
def test_count_2(self): self.assertEquals(1, IterTools.count([0]))
def has_errors(self): self.__logger.info("test of has error irregularities") self.__logger.info(list(self._irregularities)) return IterTools.count(1 for (level, _message) in self._irregularities if level == logging.ERROR)