class_docstr: Tests for the ExpandingButton class.
class_docstr_tok: ["Tests","for","the","ExpandingButton","class","."]
docstr: Test the simplest creation of an ExpandingButton.
docstr_tok: ["Test","the","simplest","creation","of","an","ExpandingButton","."]
code: def test_init(self, MockHovertip):
      """Test the simplest creation of an ExpandingButton."""
      squeezer = self.make_mock_squeezer()
      text_widget = squeezer.editwin.text
  
      expandingbutton = ExpandingButton("TEXT", "TAGS", 50, squeezer)
      self.assertEqual(expandingbutton.s, "TEXT")
  
      # Check that the underlying tkinter.Button is properly configured.
      self.assertEqual(expandingbutton.master, text_widget)
      self.assertTrue("50 lines" in expandingbutton.cget("text"))
  
      # Check that the text widget still contains no text.
      self.assertEqual(text_widget.get("1.0", "end"), "\n")
  
      # Check that the mouse events are bound.
      self.assertIn("<Double-Button-1>", expandingbutton.bind())
      right_button_code = "<Button-%s>" % (
          "2" if macosx.isAquaTk() else "3"
      )
      self.assertIn(right_button_code, expandingbutton.bind())
  
      # Check that ToolTip was called once, with appropriate values.
      self.assertEqual(MockHovertip.call_count, 1)
      MockHovertip.assert_called_with(
          expandingbutton, ANY, hover_delay=ANY
      )
  
      # Check that 'right-click' appears in the tooltip text.
      tooltip_text = MockHovertip.call_args[0][1]
      self.assertIn("right-click", tooltip_text.lower())
  
imports: from textwrap import dedent
  from tkinter import Text, Tk
  import unittest
  from unittest.mock import Mock, NonCallableMagicMock, patch, sentinel, ANY
  from test.support import requires
  from idlelib.config import idleConf
  from idlelib.percolator import Percolator
  from idlelib.squeezer import count_lines_with_wrapping, ExpandingButton, Squeezer
  from idlelib import macosx
  from idlelib.textview import view_text
  from idlelib.tooltip import Hovertip
label_desc: Use image node_id 2 for calling the ExpandingButtonTest obj's underlying member method code with example usage: obj.test_init(MockHovertip) without return types