コード例 #1
0
ファイル: test_EmbeddedR.py プロジェクト: scottcode/rpy2
 def testSetReadConsole(self):
     yes = "yes\n"
     def sayyes(prompt):
         return yes
     rinterface.set_readconsole(sayyes)
     self.assertEqual(rinterface.get_readconsole(), sayyes)
     res = rinterface.baseenv["readline"]()
     self.assertEqual(yes.strip(), res[0])
     rinterface.set_readconsole(rinterface.consoleRead)
コード例 #2
0
    def testSetReadConsole(self):
        yes = "yes\n"

        def sayyes(prompt):
            return yes

        rinterface.set_readconsole(sayyes)
        self.assertEqual(rinterface.get_readconsole(), sayyes)
        res = rinterface.baseenv["readline"]()
        self.assertEqual(yes.strip(), res[0])
        rinterface.set_readconsole(rinterface.consoleRead)