def test_cantChangeFileMode(self):
        """
        Opening a L{LogFile} which can be read and write but whose mode can't
        be changed doesn't trigger an error.
        """
        if runtime.platform.isWindows():
            name, directory = "NUL", ""
            expectedPath = "NUL"
        else:
            name, directory = "null", "/dev"
            expectedPath = "/dev/null"

        log = logfile.LogFile(name, directory, defaultMode=0o555)
        self.addCleanup(log.close)

        self.assertEqual(log.path, expectedPath)
        self.assertEqual(log.defaultMode, 0o555)

        Opening a L{LogFile} which can be read and write but whose mode can't
        be changed doesn't trigger an error.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_logfile.py