Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohdan Dobrovolskyi committed Mar 13, 2024
1 parent 8a9b9da commit f4ba7d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion featureflags_client/http/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def except_false(func: Callable) -> Callable:
def wrapper(ctx: Dict[str, Any]) -> Any:
try:
return func(ctx)
except TypeError:
except (TypeError, ValueError):
return False

return wrapper
Expand Down
3 changes: 3 additions & 0 deletions featureflags_client/tests/http/test_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def test_percent():

assert check_op(_UNDEFINED, percent, 100) is False

assert check_op("foo", percent, '100') is True
assert check_op("foo", percent, 'not_number') is False


def test_regexp():
assert check_op("anything", regexp, ".") is True
Expand Down

0 comments on commit f4ba7d8

Please sign in to comment.