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

Method test_write_not_stdout

Lib/idlelib/idle_test/test_squeezer.py:157–169  ·  view source on GitHub ↗

Test Squeezer's overriding of the EditorWindow's write() method.

(self)

Source from the content-addressed store, hash-verified

155 self.assertEqual(len(squeezer.expandingbuttons), 0)
156
157 def test_write_not_stdout(self):
158 """Test Squeezer's overriding of the EditorWindow's write() method."""
159 for text in ['', 'TEXT', 'LONG TEXT' * 1000, 'MANY_LINES\n' * 100]:
160 editwin = self.make_mock_editor_window()
161 editwin.write.return_value = SENTINEL_VALUE
162 orig_write = editwin.write
163 squeezer = self.make_squeezer_instance(editwin)
164
165 self.assertEqual(squeezer.editwin.write(text, "stderr"),
166 SENTINEL_VALUE)
167 self.assertEqual(orig_write.call_count, 1)
168 orig_write.assert_called_with(text, "stderr")
169 self.assertEqual(len(squeezer.expandingbuttons), 0)
170
171 def test_write_stdout(self):
172 """Test Squeezer's overriding of the EditorWindow's write() method."""

Callers

nothing calls this directly

Calls 5

assert_called_withMethod · 0.80
assertEqualMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected