diff --git a/src/rougail/convert/object_model.py b/src/rougail/convert/object_model.py index 573d57159..fe7e2294b 100644 --- a/src/rougail/convert/object_model.py +++ b/src/rougail/convert/object_model.py @@ -829,12 +829,12 @@ class InformationCalculation(Calculation): msg = _( 'cannot find variable "{0}" for the information "{1}" when calculating "{2}"' ).format(self.variable, self.information, self.attribute_name) - raise DictConsistencyError(msg, 40, variable.xmlfiles) + raise DictConsistencyError(msg, 40, self.xmlfiles) if identifier is not None: msg = _( 'identifier not allowed for the information "{0}" when calculating "{1}"' ).format(self.information, self.attribute_name) - raise DictConsistencyError(msg, 41, variable.xmlfiles) + raise DictConsistencyError(msg, 41, self.xmlfiles) if variable: params[None][0]["variable"] = variable if self.default_values: diff --git a/tests/errors/25_0information_with_identifier/errno_41 b/tests/errors/25_0information_with_identifier/errno_41 new file mode 100644 index 000000000..e69de29bb diff --git a/tests/errors/25_0information_with_identifier/rougail/00_file.yml b/tests/errors/25_0information_with_identifier/rougail/00_file.yml new file mode 100644 index 000000000..2de880099 --- /dev/null +++ b/tests/errors/25_0information_with_identifier/rougail/00_file.yml @@ -0,0 +1,17 @@ +--- +version: 1.1 + +fam_{{ identifier }}: + description: my dyn family + dynamic: + - var1 + - var2 + + var: + +var2: + description: my var 2 + default: + type: information + information: info + variable: _.fam_var1.var diff --git a/tests/errors/25_0unknown_information/errno_40 b/tests/errors/25_0unknown_information/errno_40 new file mode 100644 index 000000000..e69de29bb diff --git a/tests/errors/25_0unknown_information/rougail/00_file.yml b/tests/errors/25_0unknown_information/rougail/00_file.yml new file mode 100644 index 000000000..be2a6eead --- /dev/null +++ b/tests/errors/25_0unknown_information/rougail/00_file.yml @@ -0,0 +1,9 @@ +--- +version: 1.1 + +var: + description: my var + default: + type: information + information: info + variable: a.unknown.variable