change str_to_bool func

Change str_to_bool func allowing for providing a CA Cert - Useful for Bumper
This commit is contained in:
Brian Martin
2019-06-14 09:11:52 -04:00
parent 3e1efae8ef
commit 3c9c834e34
2 changed files with 21 additions and 5 deletions
+8 -1
View File
@@ -388,5 +388,12 @@ def a_vacbot(bot=None, iotmq=False, monitor=False):
bot, 'na', monitor=monitor)
def test_str_to_bool():
assert_raises(ValueError, str_to_bool, None) #Value error if str_to_bool can't convert
assert_raises(ValueError, str_to_bool_or_cert, None) #Value error if str_to_bool can't convert
assert_equals(True, str_to_bool_or_cert("True"))
assert_equals(False, str_to_bool_or_cert("False"))
assert_equals(
os.path.abspath(os.path.join(".", "tests", "test_vacbot.py")),
str_to_bool_or_cert(os.path.abspath(os.path.join(".","tests","test_vacbot.py")))
)
assert_raises(ValueError, str_to_bool_or_cert ,(os.path.abspath(os.path.join(".","tests"))))