Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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