Searched hist:"0 f5fa532" (Results 1 – 1 of 1) sorted by relevance
/openbmc/openbmc-test-automation/lib/ |
H A D | gen_valid.py | 0f5fa532 Thu Feb 13 10:51:40 CST 2020 Michael Walsh <micwalsh@us.ibm.com> Validation of list args for valid_values() Added code to ensure that valid_values and invalid_values are lists. If they are not, the user can get unexpected results. Example: var1 = 'enabled' valid_value(var1, valid_values='enableddd') In this case, valid_values is a string so when the function does this: if var1 in valid_values: The answer will be "yes" so will will get an incorrect validation. The correct invocation should be this: valid_value(var1, valid_values=['enableddd']) Which correctly yields a failure: var1: enabled <str> It must be one of the following values: valid_values: <list> [0]: enableddd <str> Change-Id: I2d10a00a4cc372af4c2eacc0dc33afbaa0ccf3a7 Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
|