def test_writing(self):
        """
        A daily log file can be written to like an ordinary log file.
        """
        with contextlib.closing(RiggedDailyLogFile(self.name, self.dir)) as log:
            log.write("123")
            log.write("456")
            log.flush()
            log.write("7890")

        with open(self.path) as f:
            self.assertEqual(f.read(), "1234567890")

        A daily log file can be written to like an ordinary log file.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_logfile.py