class_docstr: Tests for the generate_shifted_tapes function
class_docstr_tok: ["Tests","for","the","generate_shifted_tapes","function"]
docstr: Test that the function behaves as expected
code: def test_behaviour(self):
      """Test that the function behaves as expected"""
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.PauliZ(0)
          qml.RX(1.0, wires=0)
          qml.CNOT(wires=[0, 2])
          qml.Rot(2.0, 3.0, 4.0, wires=0)
          qml.expval(qml.PauliZ(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {0, 2}
      shifts = [0.1, -0.2, 1.6]
      res = generate_shifted_tapes(tape, 1, shifts)
  
      assert len(res) == len(shifts)
      assert res[0].get_parameters(trainable_only=False) == [
          1.0,
          2.0,
          3.1,
          4.0,
      ]
      assert res[1].get_parameters(trainable_only=False) == [
          1.0,
          2.0,
          2.8,
          4.0,
      ]
      assert res[2].get_parameters(trainable_only=False) == [
          1.0,
          2.0,
          4.6,
          4.0,
      ]
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients.general_shift_rules import eigvals_to_frequencies, frequencies_to_period, generate_shift_rule, _get_shift_rule, generate_multi_shift_rule, generate_shifted_tapes, generate_multishifted_tapes, _iterate_shift_rule_with_multipliers
label_desc: Use image node_id 1 for calling the TestGenerateShiftedTapes obj's underlying member method code with example usage: obj.test_behaviour() without return types