'Return None if rendering the template fails.'

@patch('socket.socket')
@patch('select.select', return_value=(True, False, False))
def test_update_returns_if_template_render_fails(self, mock_select, mock_socket):

    test_value = 'test_value'
    mock_socket = mock_socket().__enter__()
    mock_socket.recv.return_value = test_value.encode()
    config = copy(TEST_CONFIG['sensor'])
    config[tcp.CONF_VALUE_TEMPLATE] = Template("{{    this    won't    work")
    sensor = tcp.TcpSensor(self.hass, config)
    assert (sensor.update() is None)
