def test_maxNumberOfLog(self):
        log = logfile.LogFile(self.name, self.dir, rotateLength=10,
                              maxRotatedFiles=3)
        log.write("1" * 11)
        log.write("2" * 11)
        self.failUnless(os.path.exists("%s.1" % self.path))

        log.write("3" * 11)
        self.failUnless(os.path.exists("%s.2" % self.path))

        log.write("4" * 11)
        self.failUnless(os.path.exists("%s.3" % self.path))
        self.assertEqual(file("%s.3" % self.path).read(), "1" * 11)

        log.write("5" * 11)
        self.assertEqual(file("%s.3" % self.path).read(), "2" * 11)
        self.failUnless(not os.path.exists("%s.4" % self.path))
Test it respect the limit on the number of files when maxRotatedFiles
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/test/test_logfile.py/LogFileTestCase.test_maxNumberOfLog