Skip to content

Commit 524ce4a

Browse files
committed
fix failing test
1 parent 0afdce7 commit 524ce4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

functions-python/helpers/tests/test_transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_to_boolean():
1414
assert to_boolean("0") is False
1515
assert to_boolean("no") is False
1616
assert to_boolean("n") is False
17-
assert to_boolean(1) is False
17+
assert to_boolean(1) is True
1818
assert to_boolean(0) is False
1919
assert to_boolean(None) is False
2020
assert to_boolean([]) is False

functions-python/helpers/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def to_boolean(value, default_value: Optional[bool] = False) -> bool:
2525
if isinstance(value, (int, float)):
2626
return value != 0
2727
if isinstance(value, str):
28-
return value.strip().lower() in {"true", "1", "yes", "y"}
28+
return value.strip().lower() in ["true", "1", "yes", "y"]
2929
return default_value
3030

3131

0 commit comments

Comments
 (0)