def test_socket_timeout():
    'Test socket timeout validator.'
    schema = vol.Schema(cv.socket_timeout)
    with pytest.raises(vol.Invalid):
        schema(0.0)
    with pytest.raises(vol.Invalid):
        schema((- 1))
    assert (_GLOBAL_DEFAULT_TIMEOUT == schema(None))
    assert (schema(1) == 1.0)
Test socket timeout validator.
def test_socket_timeout():
    
    schema = vol.Schema(cv.socket_timeout)
    with pytest.raises(vol.Invalid):
        schema(0.0)
    with pytest.raises(vol.Invalid):
        schema((- 1))
    assert (_GLOBAL_DEFAULT_TIMEOUT == schema(None))
    assert (schema(1) == 1.0)