code: def test_addcmd(self):
      text = self.text
      # when number of undo operations exceeds max_undo
      self.delegator.max_undo = max_undo = 10
      for i in range(max_undo + 10):
          text.insert("insert", "foo")
          self.assertLessEqual(len(self.delegator.undolist), max_undo)
  
file_path: cpython/Lib/idlelib/idle_test/test_undo.py
imports: from idlelib.undo import UndoDelegator
  import unittest
  from test.support import requires
  from unittest.mock import Mock
  from tkinter import Text, Tk
  from idlelib.percolator import Percolator
label_desc: Use image node_id 10 for calling the UndoDelegatorTest obj's underlying member method code with example usage: obj.test_addcmd() without return types