test multiple xmlfiles in error

This commit is contained in:
Emmanuel Garette 2020-12-22 21:11:14 +01:00
parent 90bd72de69
commit 0e08757e22
7 changed files with 47 additions and 4 deletions

View File

@ -1064,7 +1064,8 @@ class ConstraintAnnotator:
fill = fills[idx] fill = fills[idx]
# test if it's redefined calculation # test if it's redefined calculation
if fill.target in targets and not fill.redefine: if fill.target in targets and not fill.redefine:
raise DictConsistencyError(_(f"A fill already exists for the target: {fill.target}")) xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles)
raise DictConsistencyError(_(f'A fill already exists for the target of "{fill.target}" created in {xmlfiles}'))
targets.append(fill.target) targets.append(fill.target)
# #
if fill.name not in self.functions: if fill.name not in self.functions:

View File

@ -323,8 +323,7 @@ class CreoleObjSpace:
) -> str: ) -> str:
if len(xmlfiles) == 1: if len(xmlfiles) == 1:
return '"' + xmlfiles[0] + '"' return '"' + xmlfiles[0] + '"'
else: return '"' + '", "'.join(xmlfiles[:-1]) + '"' + ' and ' + '"' + xmlfiles[-1] + '"'
return '"' + '", "'.join(xmlfiles[:-1]) + '"' + ' and ' + '"' + xmlfiles[-1] + '"'
def create_tree_structure(self, def create_tree_structure(self,
space, space,

View File

@ -0,0 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="oui/non" description="Redefine description" hidden="True">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" redefine="True"/>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" redefine="True" type="string"/>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -29,7 +29,8 @@ excludes = set([])
test_ok -= excludes test_ok -= excludes
test_raise -= excludes test_raise -= excludes
#test_ok = ['40condition_base_add'] #test_ok = ['40condition_base_add']
#test_raise = [] #test_ok = []
#test_raise = ['80redefine_double_error']
ORI_DIR = getcwd() ORI_DIR = getcwd()