def test_cache_file(self):
        patched_opts = dict((x, y) for x, y in six.iteritems(self.minion_opts))
        patched_opts.update(MOCKED_OPTS)

        with patch.dict(fileclient.__opts__, patched_opts):
            client = fileclient.get_file_client(fileclient.__opts__, pillar=False)
            for saltenv in SALTENVS:
                self.assertTrue(
                    client.cache_file('salt://foo.txt', saltenv, cachedir=None)
                )
                cache_loc = os.path.join(
                    fileclient.__opts__['cachedir'], 'files', saltenv, 'foo.txt')
                # Double check that the content of the cached file identifies
                # it as being from the correct saltenv. The setUp function
                # creates the file with the name of the saltenv mentioned in
                # the file, so a simple 'in' check is sufficient here. If
                # opening the file raises an exception, this is a problem, so
                # we are not catching the exception and letting it be raised so
                # that the test fails.
                with salt.utils.fopen(cache_loc) as fp_:
                    content = fp_.read()
                log.debug('cache_loc = %s', cache_loc)
                log.debug('content = %s', content)
                self.assertTrue(saltenv in content)
Compute the trimmed standard error of the mean.
dataset/ETHPy150Open saltstack/salt/tests/integration/fileclient_test.py/FileclientTest.test_cache_file--crossover with--dataset/ETHPy150Open scipy/scipy/scipy/stats/mstats_basic.py/tsem