def test_defaultPermissions(self):
        """
        Test the default permission of the log file: if the file exist, it
        should keep the permission.
        """
        with open(self.path, "wb"):
            os.chmod(self.path, 0o707)
            currentMode = stat.S_IMODE(os.stat(self.path)[stat.ST_MODE])
        log1 = logfile.LogFile(self.name, self.dir)
        self.assertEqual(stat.S_IMODE(os.stat(self.path)[stat.ST_MODE]),
                          currentMode)
        self.addCleanup(log1.close)

        Test the default permission of the log file: if the file exist, it
        should keep the permission.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_logfile.py