'Return if connecting to host fails.'

@patch('socket.socket.connect', side_effect=socket.error())
def test_update_returns_if_connecting_fails(self, *args):

    with patch('homeassistant.components.sensor.tcp.TcpSensor.update'):
        sensor = tcp.TcpSensor(self.hass, TEST_CONFIG['sensor'])
    assert (sensor.update() is None)
