def test_other_values(self): """ Tests string_to_bool function for values that are not predefined strings. """ # values that should return True self.assertTrue(parserutils.string_to_bool('0')) self.assertTrue(parserutils.string_to_bool(True)) # values that should return False self.assertFalse(parserutils.string_to_bool(0)) self.assertFalse(parserutils.string_to_bool(None)) self.assertFalse(parserutils.string_to_bool(False))
def test_false_strings(self): """ Tests string_to_bool function for strings that should return False. """ self.assertFalse(parserutils.string_to_bool('false')) self.assertFalse(parserutils.string_to_bool('False'))
def test_true_strings(self): """ Tests string_to_bool function for strings that should return True. """ self.assertTrue(parserutils.string_to_bool('true')) self.assertTrue(parserutils.string_to_bool('True'))