def test_boolean():
    'Test boolean validation.'
    schema = vol.Schema(cv.boolean)
    for value in ('T', 'negative', 'lock'):
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    for value in ('true', 'On', '1', 'YES', 'enable', 1, True):
        assert schema(value)
    for value in ('false', 'Off', '0', 'NO', 'disable', 0, False):
        assert (not schema(value))
Test boolean validation.
def test_boolean():
    
    schema = vol.Schema(cv.boolean)
    for value in ('T', 'negative', 'lock'):
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    for value in ('true', 'On', '1', 'YES', 'enable', 1, True):
        assert schema(value)
    for value in ('false', 'Off', '0', 'NO', 'disable', 0, False):
        assert (not schema(value))