Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Lib/test/test_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,12 @@ def test_pad(self):
pad.addstr(0, 0, 'PADTEXT')
self.assertEqual(pad.instr(0, 0, 7), b'PADTEXT')

# subpad() shares the parent pad's character cells.
# subpad() creates a pad within the parent pad. Cell sharing with
# the parent is implementation-defined, so write to the subpad itself.
sub = pad.subpad(3, 5, 0, 0)
self.assertEqual(sub.getmaxyx(), (3, 5))
self.assertEqual(sub.instr(0, 0, 5), b'PADTE')
sub.addstr(1, 0, 'sub')
self.assertEqual(sub.instr(1, 0, 3), b'sub')

# A pad is refreshed onto an explicit screen rectangle; the
# 6-argument form is required (and rejected for ordinary windows).
Expand Down Expand Up @@ -414,7 +416,8 @@ def test_coordinate_errors(self):
self.assertRaises(curses.error, win.move, -1, -1)
self.assertRaises(curses.error, win.addch, 100, 100, ord('x'))
self.assertRaises(curses.error, win.inch, 100, 100)
self.assertRaises(curses.error, win.chgat, 100, 0, curses.A_BOLD)
if hasattr(win, 'chgat'): # chgat() requires wchgat()
self.assertRaises(curses.error, win.chgat, 100, 0, curses.A_BOLD)

def test_argument_errors(self):
win = curses.newwin(5, 10, 0, 0)
Expand Down
Loading