def setUp(self):
        '''
        No need to add a dummy foo.txt to muddy up the github repo, just make
        our own fileserver root on-the-fly.
        '''
        def _new_dir(path):
            '''
            Add a new dir at ``path`` using os.makedirs. If the directory
            already exists, remove it recursively and then try to create it
            again.
            '''
            try:
                os.makedirs(path)
            except __HOLE__ as exc:
                if exc.errno == errno.EEXIST:
                    # Just in case a previous test was interrupted, remove the
                    # directory and try adding it again.
                    shutil.rmtree(path)
                    os.makedirs(path)
                else:
                    raise

        # Crete the FS_ROOT
        for saltenv in SALTENVS:
            saltenv_root = os.path.join(FS_ROOT, saltenv)
            # Make sure we have a fresh root dir for this saltenv
            _new_dir(saltenv_root)

            path = os.path.join(saltenv_root, 'foo.txt')
            with salt.utils.fopen(path, 'w') as fp_:
                fp_.write(
                    'This is a test file in the \'{0}\' saltenv.\n'
                    .format(saltenv)
                )

            subdir_abspath = os.path.join(saltenv_root, SUBDIR)
            os.makedirs(subdir_abspath)
            for subdir_file in SUBDIR_FILES:
                path = os.path.join(subdir_abspath, subdir_file)
                with salt.utils.fopen(path, 'w') as fp_:
                    fp_.write(
                        'This is file \'{0}\' in subdir \'{1} from saltenv '
                        '\'{2}\''.format(subdir_file, SUBDIR, saltenv)
                    )

        # Create the CACHE_ROOT
        _new_dir(CACHE_ROOT)
dataset/ETHPy150Open saltstack/salt/tests/integration/fileclient_test.py/FileclientTest.setUp