MCPcopy Create free account
hub / github.com/python/cpython / test_delete

Method test_delete

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

Source from the content-addressed store, hash-verified

240
241 @mock.patch.object(colorizer.ColorDelegator, 'notify_range')
242 def test_delete(self, mock_notify):
243 text = self.text
244 # Initialize text.
245 text.insert('insert', 'abcdefghi')
246 self.assertEqual(text.get('1.0', 'end'), 'abcdefghi\n')
247 # Delete single character.
248 text.delete('1.7')
249 self.assertEqual(text.get('1.0', 'end'), 'abcdefgi\n')
250 mock_notify.assert_called_with('1.7')
251 # Delete multiple characters.
252 text.delete('1.3', '1.6')
253 self.assertEqual(text.get('1.0', 'end'), 'abcgi\n')
254 mock_notify.assert_called_with('1.3')
255
256 def test_notify_range(self):
257 text = self.text

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected