MCPcopy Index your code
hub / github.com/python/cpython / make_mock_editor_window

Method make_mock_editor_window

Lib/idlelib/idle_test/test_squeezer.py:83–93  ·  view source on GitHub ↗

Create a mock EditorWindow instance.

(self, with_text_widget=False)

Source from the content-addressed store, hash-verified

81class SqueezerTest(unittest.TestCase):
82 """Tests for the Squeezer class."""
83 def make_mock_editor_window(self, with_text_widget=False):
84 """Create a mock EditorWindow instance."""
85 editwin = NonCallableMagicMock()
86 editwin.width = 80
87
88 if with_text_widget:
89 editwin.root = get_test_tk_root(self)
90 text_widget = self.make_text_widget(root=editwin.root)
91 editwin.text = editwin.per.bottom = text_widget
92
93 return editwin
94
95 def make_squeezer_instance(self, editor_window=None):
96 """Create an actual Squeezer instance with a mock EditorWindow."""

Callers 11

test_count_linesMethod · 0.95
test_initMethod · 0.95
test_write_no_tagsMethod · 0.95
test_write_not_stdoutMethod · 0.95
test_write_stdoutMethod · 0.95
test_auto_squeezeMethod · 0.95
test_reloadMethod · 0.95

Calls 3

make_text_widgetMethod · 0.95
get_test_tk_rootFunction · 0.85

Tested by

no test coverage detected