From 5c92d03ca45bfd9f249ab1768d6fed9c8b812fda Mon Sep 17 00:00:00 2001 From: Jason Collins Date: Sun, 1 Sep 2024 17:22:06 +1000 Subject: [PATCH] add test to ensure Issue #213 is not repeated --- test/test_ui.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_ui.py b/test/test_ui.py index bf11697..9ba83a8 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -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):