How to use the peru.cache.Cache function in peru

To help you get started, we’ve selected a few peru examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buildinspace / peru / tests / test_cache.py View on Github external
async def setUp(self):
        self.cache = await peru.cache.Cache(create_dir())
        self.content = {
            'a': 'foo',
            'b/c': 'bar',
            'b/d': 'baz',
        }
        self.content_dir = create_dir(self.content)
        self.content_tree = await self.cache.import_tree(self.content_dir)
github buildinspace / peru / tests / test_rule.py View on Github external
async def setUp(self):
        self.cache_dir = shared.create_dir()
        self.cache = await cache.Cache(self.cache_dir)
        # Include a leading colon to test that we prepend ./ to pathspecs.
        self.content = {'a': 'foo', 'b/c': 'bar', COLON + 'd': 'baz'}
        self.content_dir = shared.create_dir(self.content)
        self.content_tree = await self.cache.import_tree(self.content_dir)
        self.entries = await self.cache.ls_tree(
            self.content_tree, recursive=True)
github buildinspace / peru / tests / test_merge.py View on Github external
async def setUp(self):
        self.cache_dir = create_dir()
        self.cache = await Cache(self.cache_dir)

        # These tests use this simple one-file tree as module contents.
        content = {'a': 'a'}
        content_dir = create_dir(content)
        self.content_tree = await self.cache.import_tree(content_dir)
github buildinspace / peru / peru / runtime.py View on Github external
async def _init_cache(self):
        self.cache = await cache.Cache(self.cache_dir)