def testSetFlushConsole(self): flush = {'count': 0} def f(): flush['count'] = flush['count'] + 1 rinterface.set_flushconsole(f) self.assertEqual(rinterface.get_flushconsole(), f) rinterface.baseenv.get("flush.console")() self.assertEqual(1, flush['count']) rinterface.set_writeconsole(rinterface.consoleFlush)
def testSetFlushConsole(self): flush = {"count": 0} def f(): flush["count"] = flush["count"] + 1 rinterface.set_flushconsole(f) self.assertEqual(rinterface.get_flushconsole(), f) rinterface.baseenv.get("flush.console")() self.assertEqual(1, flush["count"]) rinterface.set_writeconsole_regular(rinterface.consoleFlush)