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

Method test_refresh_control

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

Source from the content-addressed store, hash-verified

205 self.assertEqual(stdscr.getyx(), (4, 9))
206
207 def test_refresh_control(self):
208 stdscr = self.stdscr
209 # touchwin()/untouchwin()/is_wintouched()
210 stdscr.refresh()
211 self.assertIs(stdscr.is_wintouched(), False)
212 stdscr.touchwin()
213 self.assertIs(stdscr.is_wintouched(), True)
214 stdscr.refresh()
215 self.assertIs(stdscr.is_wintouched(), False)
216 stdscr.touchwin()
217 self.assertIs(stdscr.is_wintouched(), True)
218 stdscr.untouchwin()
219 self.assertIs(stdscr.is_wintouched(), False)
220
221 # touchline()/untouchline()/is_linetouched()
222 stdscr.touchline(5, 2)
223 self.assertIs(stdscr.is_linetouched(5), True)
224 self.assertIs(stdscr.is_linetouched(6), True)
225 self.assertIs(stdscr.is_wintouched(), True)
226 stdscr.touchline(5, 1, False)
227 self.assertIs(stdscr.is_linetouched(5), False)
228
229 # syncup()
230 win = stdscr.subwin(10, 15, 2, 5)
231 win2 = win.subwin(5, 10, 3, 7)
232 win2.touchwin()
233 stdscr.untouchwin()
234 win2.syncup()
235 self.assertIs(win.is_wintouched(), True)
236 self.assertIs(stdscr.is_wintouched(), True)
237
238 # syncdown()
239 stdscr.touchwin()
240 win.untouchwin()
241 win2.untouchwin()
242 win2.syncdown()
243 self.assertIs(win2.is_wintouched(), True)
244
245 # syncok()
246 if hasattr(stdscr, 'syncok') and not sys.platform.startswith("sunos"):
247 win.untouchwin()
248 stdscr.untouchwin()
249 for syncok in [False, True]:
250 win2.syncok(syncok)
251 win2.addch('a')
252 self.assertIs(win.is_wintouched(), syncok)
253 self.assertIs(stdscr.is_wintouched(), syncok)
254
255 def test_output_character(self):
256 stdscr = self.stdscr

Callers

nothing calls this directly

Calls 3

refreshMethod · 0.45
assertIsMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected