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

Method test_clear

Lib/test/test_curses.py:390–408  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

388 self.assertEqual(win.instr(1, 0), b'amet dolor ')
389
390 def test_clear(self):
391 win = curses.newwin(5, 15, 5, 2)
392 lorem_ipsum(win)
393
394 win.move(0, 8)
395 win.clrtoeol()
396 self.assertEqual(win.instr(0, 0).rstrip(), b'Lorem ip')
397 self.assertEqual(win.instr(1, 0).rstrip(), b'dolor sit amet,')
398
399 win.move(0, 3)
400 win.clrtobot()
401 self.assertEqual(win.instr(0, 0).rstrip(), b'Lor')
402 self.assertEqual(win.instr(1, 0).rstrip(), b'')
403
404 for func in [win.erase, win.clear]:
405 lorem_ipsum(win)
406 func()
407 self.assertEqual(win.instr(0, 0).rstrip(), b'')
408 self.assertEqual(win.instr(1, 0).rstrip(), b'')
409
410 def test_insert_delete(self):
411 win = curses.newwin(5, 15, 5, 2)

Callers

nothing calls this directly

Calls 5

lorem_ipsumFunction · 0.85
funcFunction · 0.70
moveMethod · 0.45
assertEqualMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected