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

Method test_insert

Lib/idlelib/idle_test/test_colorizer.py:230–239  ·  view source on GitHub ↗
(self, mock_notify)

Source from the content-addressed store, hash-verified

228
229 @mock.patch.object(colorizer.ColorDelegator, 'notify_range')
230 def test_insert(self, mock_notify):
231 text = self.text
232 # Initial text.
233 text.insert('insert', 'foo')
234 self.assertEqual(text.get('1.0', 'end'), 'foo\n')
235 mock_notify.assert_called_with('1.0', '1.0+3c')
236 # Additional text.
237 text.insert('insert', 'barbaz')
238 self.assertEqual(text.get('1.0', 'end'), 'foobarbaz\n')
239 mock_notify.assert_called_with('1.3', '1.3+6c')
240
241 @mock.patch.object(colorizer.ColorDelegator, 'notify_range')
242 def test_delete(self, mock_notify):

Callers

nothing calls this directly

Calls 4

assert_called_withMethod · 0.80
insertMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected