@@ -824,28 +824,36 @@ def test_align_right_wide_fill_needs_padding():
824824 assert aligned == fill_char + ' ' + text
825825
826826
827- def test_str_to_bool_true ():
828- assert cu .str_to_bool ('true' )
829- assert cu .str_to_bool ('True' )
830- assert cu .str_to_bool ('TRUE' )
831- assert cu .str_to_bool ('tRuE' )
827+ def test_to_bool_str_true ():
828+ assert cu .to_bool ('true' )
829+ assert cu .to_bool ('True' )
830+ assert cu .to_bool ('TRUE' )
831+ assert cu .to_bool ('tRuE' )
832832
833833
834- def test_str_to_bool_false ():
835- assert not cu .str_to_bool ('false' )
836- assert not cu .str_to_bool ('False' )
837- assert not cu .str_to_bool ('FALSE' )
838- assert not cu .str_to_bool ('fAlSe' )
834+ def test_to_bool_str_false ():
835+ assert not cu .to_bool ('false' )
836+ assert not cu .to_bool ('False' )
837+ assert not cu .to_bool ('FALSE' )
838+ assert not cu .to_bool ('fAlSe' )
839839
840840
841- def test_str_to_bool_invalid ():
841+ def test_to_bool_str_invalid ():
842842 with pytest .raises (ValueError ):
843- cu .str_to_bool ('other' )
843+ cu .to_bool ('other' )
844844
845845
846- def test_str_to_bool_bad_input ():
847- with pytest .raises (ValueError ):
848- cu .str_to_bool (1 )
846+ def test_to_bool_int ():
847+ assert cu .to_bool (1 )
848+ assert cu .to_bool (- 1 )
849+ assert not cu .to_bool (0 )
850+
851+
852+ def test_to_bool_float ():
853+ assert cu .to_bool (2.35 )
854+ assert cu .to_bool (0.25 )
855+ assert cu .to_bool (- 3.1415 )
856+ assert not cu .to_bool (0 )
849857
850858
851859def test_find_editor_specified ():
0 commit comments