class_docstr: Tests generic controlled gates
class_docstr_tok: ["Tests","generic","controlled","gates"]
docstr: Test a variety of non-special gates. Checks control wires are drawn, and
  that a box is drawn over the target wires.
code: def test_control_gates(self, op, label):
      """Test a variety of non-special gates. Checks control wires are drawn, and
      that a box is drawn over the target wires."""
  
      with qml.queuing.AnnotatedQueue() as q_tape:
          qml.apply(op)
  
      tape = QuantumScript.from_queue(q_tape)
      _, ax = tape_mpl(tape)
      layer = 0
  
      assert isinstance(ax.patches[0], mpl.patches.Circle)
      assert ax.patches[0].center == (layer, 0)
  
      control_line = ax.lines[2]
      assert control_line.get_data() == ((layer, layer), (0, 1))
  
      assert isinstance(ax.patches[1], mpl.patches.FancyBboxPatch)
      assert ax.patches[1].get_x() == layer - self.width / 2.0
      assert ax.patches[1].get_y() == 1 - self.width / 2.0
  
      # two wire labels, so [2] is box gate label
      assert ax.texts[2].get_text() == label
  
      # box and text must be raised above control wire
      # text raised over box
      assert ax.patches[1].get_zorder() > control_line.get_zorder()
      assert ax.texts[2].get_zorder() > ax.patches[1].get_zorder()
  
      plt.close()
  
imports: import pytest
  import pennylane
  from pennylane.drawer import tape_mpl
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 1 for calling the TestControlledGates obj's underlying member method code with example usage: obj.test_control_gates(op, label) without return types