Skip to content

Commit

Permalink
add test to ensure Issue PyFixate#213 is not repeated
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollins1983 committed Sep 1, 2024
1 parent 46f3f47 commit 5c92d03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def test_user_input_float(mock_user_interface):
assert resp == 1.23


def test_user_input_float_0(mock_user_interface):
# test that 0 is a valid float, prevent issue #213 from recurring
mock_user_interface.test_value = "0"
resp = user_input_float("message")
assert resp == 0.0


def test_user_input_float_fails(mock_user_interface):
mock_user_interface.test_value = "abc"
with pytest.raises(UserInputError):
Expand Down

0 comments on commit 5c92d03

Please sign in to comment.