simulation: improve equivalence testers explanations messages
With latest simulation, the explanation given to user when solving a divergence was not good enough :
- Property ids were displayed without possibility to display business word (like displaying 'stop_date' instead of 'Delivery Date'
- Some message was displayed in the solve divergence dialog whatever was the equivalence tester behind. Therefore, customizations of messages made a equivalence tester level were not displayed to user
Therefore, following was done:
- in solve divergence dialog, include the message generated by the equivalence tester
- use tested_property_title to allow using business words to describe properties having divergence
- most equivalence testers are written in a way to evaluate divergence on a single property. To have better UI configuration of such equivalence testers, change tested_property and tested_property_title properties type from "lines" to "string". This required to add some backward compatible code.
- use Variation Divergence Tester to show a case of an equivalence tester using different properties. For this, add a property sheet dedicated to multi properties equivalence testers
- update propertysheets to allow translating tested_property_title
Source branch seb does not exist
Please restore the source branch or close this merge request and open a new merge request with a different source branch.
To have a look on the result, I took a few screenshots.
First one, original dialog with no translation :
Then, original dialog with translation :
Then, dialog after changes, with no translation :
Finally, dialog after changes, with translation (some translation in German, and some other in French since I don't know German ;) ) :
What should happen if existing tested_property value has two or more values ? And if we assume it should be up to one, it can be implemented like the following.
+def getTestedProperty(self): + """ + Override getTestedProperty to fix the way it is stored. Some time + ago it was multi-valued, which is non-sense we the implementation we + have on this equivalence tester. + """ + tested_property = self._baseGetTestedProperty() + if isinstance(tested_property, tuple): + tested_property = tested_property + self._baseSetTestedProperty(tested_property) + return tested_property
I prefer that getTestedProperty does nothing instead of trying to try handling unexpected cases. If you have already several properties, may be there was some reasons, so we should not automatically reduce to one, this sounds like destroying data.
In your code, it sounds nicer to use self._baseGetTestedProperty instead of a getattr, I though _baseGetTestedProperty was going to change my data into string (since the property is set to string), but it returns the tuple. So I can use it.