code: def setUpClass(cls):
      cls.engine = se.SearchEngine(None)
      ##        requires('gui')
      ##        cls.root = Tk()
      ##        cls.text = Text(master=cls.root)
      cls.text = mockText()
      # search_backward calls index('end-1c')
      cls.text.index = lambda index: "4.0"
      test_text = "First line\n" "Line with target\n" "Last line\n"
      cls.text.insert("1.0", test_text)
      cls.pat = re.compile("target")
      cls.res = (2, (10, 16))  # line, slice indexes of 'target'
      cls.failpat = re.compile("xyz")  # not in text
      cls.emptypat = re.compile(r"\w*")
  
imports: from idlelib import searchengine
  import unittest
  from tkinter import BooleanVar, StringVar, TclError
  from tkinter import messagebox
  from idlelib.idle_test.mock_tk import Var, Mbox
  from idlelib.idle_test.mock_tk import Text
  import re
label_desc: Use image node_id 1 for calling the ForwardBackwardTest obj's underlying member method code with example usage: obj.setUpClass(cls) without return types