Using OpenTap 9.17.4 and I couldn’t see this issue reported or fixed in newer releases. My apologies if it is already fixed or reported.
Developing plugins on Python; when adding validation rules for multiple properties, if a property (e.g., sweep_points
) contains another property’s name (e.g., sweep
), the error message specific to that containing the other property’s name is displayed also for the other property. Below you can see the code and the screenshots related to this issue.
Properties added:
self.AddProperty("sweep", 0, UInt32)\
.AddAttribute(DisplayAttribute, "Sweep Counts", "The number of sweeps to be used to average traces.",
Groups=self.SWEEP_GROUP, Order=4.2)
self.AddProperty("sweep_points", 1001, UInt32)\
.AddAttribute(DisplayAttribute, "Sweep Points", "The number of points to be analyzed per sweep.",
Groups=self.SWEEP_GROUP, Order=4.3)
Validation rules added:
self.AddRule(lambda: 0 <= self.sweep <= self.MAX_SWEEP_COUNT,
lambda: f"Number of sweeps should be between 0 and {self.MAX_SWEEP_COUNT}", "sweep")
self.AddRule(lambda: self.MIN_SWEEP_POINT <= self.sweep_points <= self.MAX_SWEEP_POINT,
lambda: f"Number of sweep points should be between {self.MIN_SWEEP_POINT} and "
f"{self.MAX_SWEEP_POINT}", "sweep_points")
- The error message propagated to the input (
sweep
) which has nothing to do with this validation rule - The error message for the input (
sweep_points
) where the rule is violated
As I tested other possibilities, sharing a substring (e.g., sweep_points
and sweep_time
) does not cause the same problem. It only occurs if a property has another property’s name in its name as a substring. I would appreciate if you can help on this issue!