How to use the lucidity.discover_templates function in Lucidity

To help you get started, we’ve selected a few Lucidity 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 4degrees / lucidity / test / unit / test_lucidity.py View on Github external
def test_discover_with_env(path, expected, monkeypatch):
    '''Discover templates using environment variable.'''
    monkeypatch.setenv('LUCIDITY_TEMPLATE_PATH', path)
    templates = lucidity.discover_templates()
    assert map(operator.attrgetter('name'), templates) == expected
github 4degrees / lucidity / test / unit / test_lucidity.py View on Github external
def test_discover(recursive, expected):
    '''Discover templates via registration mount points.'''
    templates = lucidity.discover_templates(
        [TEST_TEMPLATE_PATH], recursive=recursive
    )
    assert map(operator.attrgetter('name'), templates) == expected