X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/09cbdc3074b3f1e69c9c537875146f6da0a6ed8f..2693a197ea37490a891c54bbb279937a7b4e897c:/sdk/python/tests/arvados_testutil.py diff --git a/sdk/python/tests/arvados_testutil.py b/sdk/python/tests/arvados_testutil.py index 3772761b88..0035659796 100644 --- a/sdk/python/tests/arvados_testutil.py +++ b/sdk/python/tests/arvados_testutil.py @@ -295,3 +295,15 @@ def make_block_cache(disk_cache): shutil.rmtree(disk_cache_dir, ignore_errors=True) block_cache = arvados.keep.KeepBlockCache(disk_cache=disk_cache) return block_cache + + +class DiskCacheBase: + def make_block_cache(self, disk_cache): + self.disk_cache_dir = tempfile.mkdtemp() if disk_cache else None + block_cache = arvados.keep.KeepBlockCache(disk_cache=disk_cache, + disk_cache_dir=self.disk_cache_dir) + return block_cache + + def tearDown(self): + if self.disk_cache_dir: + shutil.rmtree(self.disk_cache_dir)