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

Method test_long_line

Lib/idlelib/idle_test/test_format.py:294–319  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

292 self.text.delete('1.0', 'end')
293
294 def test_long_line(self):
295 text = self.text
296
297 # Set cursor ('insert' mark) to '1.0', within text.
298 text.insert('1.0', self.test_string)
299 text.mark_set('insert', '1.0')
300 self.formatter('ParameterDoesNothing', limit=70)
301 result = text.get('1.0', 'insert')
302 # find function includes \n
303 expected = (
304" '''this is a test of a reformat for a triple quoted string will it\n"
305" reformat to less than 70 characters for me?'''\n") # yes
306 self.assertEqual(result, expected)
307 text.delete('1.0', 'end')
308
309 # Select from 1.11 to line end.
310 text.insert('1.0', self.test_string)
311 text.tag_add('sel', '1.11', '1.end')
312 self.formatter('ParameterDoesNothing', limit=70)
313 result = text.get('1.0', 'insert')
314 # selection excludes \n
315 expected = (
316" '''this is a test of a reformat for a triple quoted string will it reformat\n"
317" to less than 70 characters for me?'''") # no
318 self.assertEqual(result, expected)
319 text.delete('1.0', 'end')
320
321 def test_multiple_lines(self):
322 text = self.text

Callers

nothing calls this directly

Calls 6

tag_addMethod · 0.80
insertMethod · 0.45
mark_setMethod · 0.45
getMethod · 0.45
assertEqualMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected