diff options
author | Ghostkeeper <rubend@tutanota.com> | 2016-07-21 18:21:31 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2016-07-21 19:27:49 +0300 |
commit | e371c433958d88a26f0fd4e5a1218e73261d95e3 (patch) | |
tree | 09c54385e7b4c8f6c666a52de6c294a7c99d7aa6 /tests/runtest.py | |
parent | b3f80cec831b03a31a613b938cb1efe338d57227 (diff) |
Don't evaluate default_value as fallback
Just take the value itself without evaluating it. Otherwise enum values accidentally get evaluated as a variable.
Contributes to issue CURA-1758.
Diffstat (limited to 'tests/runtest.py')
-rw-r--r-- | tests/runtest.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/runtest.py b/tests/runtest.py index 4399bcf5b..dfe27e651 100644 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -105,7 +105,10 @@ class Setting: # \param locals The local variables for eventual function evaluation. def __init__(self, key, data, locals): self._key = key - self._default = self._evaluateFunction(data.get("value", str(data.get("default_value", 0))), locals) #Evaluate "value" if we can, otherwise evaluate a stringified "default_value". + if "value" in data: #Evaluate "value" if we can, otherwise just take default_value. + self._default = self._evaluateFunction(data.get("value", "0"), locals) + else: + self._default = data.get("default_value", 0) self._type = data["type"] self._min_value = self._evaluateFunction(data.get("minimum_value", None), locals) self._max_value = self._evaluateFunction(data.get("maximum_value", None), locals) |