def test_cache_file_success(self):
        path = 'salt://saltines'
        saltenv = 'base'
        ret = path

        class MockFileClient(object):
            def cache_file(self, path, saltenv):
                return path

        mock_file_client = MockFileClient()
        with patch.dict(cp.__context__, {'cp.fileclient': mock_file_client}):
            self.assertEqual(cp.cache_file(path), ret)
DRY routine for calling aggregate spatial stored procedures and
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/cp_test.py/CpTestCase.test_cache_file_success--crossover with--dataset/ETHPy150Open dcramer/django-compositepks/django/contrib/gis/db/models/query.py/GeoQuerySet._spatial_aggregate