How to use the lucidity.Template.STRICT 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_template.py View on Github external
def test_invalid_parse_in_strict_mode(pattern, path):
    '''Fail to extract data in strict mode when invalid duplicates detected.'''
    template = Template(
        'test', pattern, duplicate_placeholder_mode=Template.STRICT
    )
    with pytest.raises(ParseError) as exception:
        template.parse(path)

    assert 'Different extracted values' in str(exception.value)