def test_protected_directory(self):
        if sys.platform == 'win32':
            raise SkipTest("Windows box has permission problems with this test")

        logging.debug('')
        logging.debug('test_protected_directory')

        # Create a protected directory.
        directory = 'protected'
        if os.path.exists(directory):
            os.rmdir(directory)
        os.mkdir(directory)
        os.chmod(directory, 0)
        exe_dir = os.path.join(directory, 'xyzzy')
        try:
            # Attempt auto-creation of execution directory in protected area.
            comp = Component()
            comp.directory = exe_dir
            comp.cpath_updated()
        except __HOLE__, exc:
            msg = ": Can't create execution directory"
            self.assertEqual(str(exc)[:len(msg)], msg)
        else:
            self.fail('Expected OSError')
        finally:
            os.chmod(directory, stat.S_IWUSR | stat.S_IWRITE | stat.S_IREAD)
            os.rmdir(directory)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_component.py/TestCase.test_protected_directory