class_docstr: Tests the one-dimensional reconstruction subroutine based on arbitrary
  shifted evaluations for arbitrary frequencies.
docstr: Test that arbitrary-frequency classical functions are
  reconstructed correctly.
docstr_tok: ["Test","that","arbitrary-frequency","classical","functions","are","reconstructed","correctly","."]
code: def test_with_classical_fun(self, fun, spectrum, mocker):
      """Test that arbitrary-frequency classical functions are
      reconstructed correctly."""
      Fun = Lambda(fun)
      spy = mocker.spy(Fun, "fun")
      rec = _reconstruct_gen(Fun, spectrum)
      assert (
          spy.call_count
          == len([f for f in spectrum if f > 0.0]) * 2 + 1
      )
      assert fun_close(fun, rec)
  
      # Repeat, using precomputed f0
      f0 = fun(0.0)
      Fun = Lambda(fun)
      spy = mocker.spy(Fun, "fun")
      rec = _reconstruct_gen(Fun, spectrum, f0=f0)
      assert spy.call_count == len([f for f in spectrum if f > 0.0]) * 2
      assert fun_close(fun, rec)
  
imports: from inspect import signature
  from itertools import chain
  from functools import reduce
  import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.fourier.reconstruct import _reconstruct_equ, _reconstruct_gen, _prepare_jobs, reconstruct
  from pennylane.fourier.utils import join_spectra
label_desc: Use image node_id 1 for calling the TestReconstructGen obj's underlying member method code with example usage: obj.test_with_classical_fun(fun, spectrum, mocker) without return types