def test_getLog(self):
        """
        Test retrieving log files with L{DailyLogFile.getLog}.
        """
        data = ["1\n", "2\n", "3\n"]
        log = RiggedDailyLogFile(self.name, self.dir)
        self.addCleanup(log.close)
        for d in data:
            log.write(d)
        log.flush()

        # This returns the current log file.
        r = log.getLog(0.0)
        self.addCleanup(r.close)

        self.assertEqual(data, r.readLines())

        # We can't get this log, it doesn't exist yet.
        self.assertRaises(ValueError, log.getLog, 86400)

        log._clock = 86401 # New day
        r.close()
        log.rotate()
        r = log.getLog(0) # We get the previous log
        self.addCleanup(r.close)
        self.assertEqual(data, r.readLines())

        Test retrieving log files with L{DailyLogFile.getLog}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_logfile.py