Completed
Push — master ( 6f6cd9...412364 )
by Michael
01:07
created

tests.test_undefined_variable_to_str()   A

Complexity

Conditions 2

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 14
rs 9.4285
1
# -*- coding: utf-8 -*-
2
3
from jinja2.exceptions import UndefinedError
4
5
from cookiecutter import exceptions
6
7
8
def test_undefined_variable_to_str():
9
    undefined_var_error = exceptions.UndefinedVariableInTemplate(
10
        'Beautiful is better than ugly',
11
        UndefinedError('Errors should never pass silently'),
12
        {'cookiecutter': {'foo': 'bar'}}
13
    )
14
15
    expected_str = (
16
        "Beautiful is better than ugly. "
17
        "Error message: Errors should never pass silently. "
18
        "Context: {'cookiecutter': {'foo': 'bar'}}"
19
    )
20
21
    assert str(undefined_var_error) == expected_str
22