code: def test_both_before_after(self):
      text = self.text
      previous = self.auto_expand.getprevword
      expand = self.auto_expand.expand_word_event
      equal = self.assertEqual
  
      text.insert("insert", "ab xy yz\n")
      text.insert("insert", "a ac by ac")
  
      text.mark_set("insert", "2.1")
      equal(self.auto_expand.getwords(), ["ab", "ac", "a"])
      expand("event")
      equal(previous(), "ab")
      expand("event")
      equal(previous(), "ac")
      expand("event")
      equal(previous(), "a")
  
file_path: cpython/Lib/idlelib/idle_test/test_autoexpand.py
imports: from idlelib.autoexpand import AutoExpand
  import unittest
  from test.support import requires
  from tkinter import Text, Tk
label_desc: Use image node_id 7 for calling the AutoExpandTest obj's underlying member method code with example usage: obj.test_both_before_after() without return types