def test_checkbox(self): assert inputs.boolean('on') is True
def test_non_strings(self): assert inputs.boolean(0) is False assert inputs.boolean(1) is True assert inputs.boolean([]) is False
def test_python_bool(self): assert inputs.boolean(True) is True assert inputs.boolean(False) is False
def test_bad_boolean(self): with pytest.raises(ValueError): inputs.boolean('blah') with pytest.raises(ValueError): inputs.boolean(None)
def test_case(self): assert inputs.boolean('FaLSE') is False assert inputs.boolean('FaLSE') is False
def test_1(self): assert inputs.boolean('1') is True
def test_true(self): assert inputs.boolean('true') is True
def test_0(self): assert inputs.boolean('0') is False
def test_false(self): assert inputs.boolean('False') is False