-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add get_bool_var for parsing boolean inputs #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests would be great like test_get_var
for get_bool
in test_action_script
including true
, false
, True
and False
.
python/publish_unit_test_results.py
Outdated
Same as get_var(), but checks if the value is a valid boolean. | ||
If the value is unset, defaults to false. | ||
""" | ||
val = get_var(name, options).lower() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_var
can return None
if name
does not exist in options
, then calling lower
fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python/publish_unit_test_results.py
Outdated
return default | ||
elif val == 'true': | ||
return True | ||
elif val is 'false': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ==
rather than is
The function raises an error when something other than true/false is used.
e82e750
to
e27d276
Compare
@ilent2 thanks for the contribution! |
The function prints a warning when something other than true/false is used. This fixes #194.