[pypy-svn] r44319 - pypy/dist/pypy/module/_curses/test

fijal at codespeak.net fijal at codespeak.net
Sun Jun 17 14:49:48 CEST 2007


Author: fijal
Date: Sun Jun 17 14:49:46 2007
New Revision: 44319

Modified:
   pypy/dist/pypy/module/_curses/test/test_curses.py
Log:
Move all curses tests to use pexpect


Modified: pypy/dist/pypy/module/_curses/test/test_curses.py
==============================================================================
--- pypy/dist/pypy/module/_curses/test/test_curses.py	(original)
+++ pypy/dist/pypy/module/_curses/test/test_curses.py	Sun Jun 17 14:49:46 2007
@@ -8,20 +8,6 @@
 import py
 import sys
 
-class AppTestCurses(object):
-    def setup_class(cls): 
-        cls.space = gettestobjspace(usemodules=['_curses'])
-
-    def test_tigetstr(self):
-        import _curses
-        _curses.setupterm()
-        assert _curses.tigetstr('cup') == '\x1b[%i%p1%d;%p2%dH'
-
-    def test_tparm(self):
-        import _curses
-        _curses.setupterm()
-        assert _curses.tparm(_curses.tigetstr('cup'), 5, 3) == '\033[6;4H'
-
 class TestCurses(object):
     """ We need to fork here, to prevent
     the setup to be done
@@ -56,6 +42,31 @@
         child = self.spawn(['--withmod-_curses', str(f)])
         child.expect('ok!')
 
+    def test_tigetstr(self):
+        source = py.code.Source("""
+        import _curses
+        _curses.setupterm()
+        assert _curses.tigetstr('cup') == '\x1b[%i%p1%d;%p2%dH'
+        print 'ok!'
+        """)
+        f = udir.join("test_tigetstr.py")
+        f.write(source)
+        child = self.spawn(['--withmod-_curses', str(f)])
+        child.expect('ok!')
+
+    def test_tparm(self):
+        source = py.code.Source("""
+        import _curses
+        _curses.setupterm()
+        assert _curses.tparm(_curses.tigetstr('cup'), 5, 3) == '\033[6;4H'
+        print 'ok!'
+        """)
+        f = udir.join("test_tparm.py")
+        f.write(source)
+        child = self.spawn(['--withmod-_curses', str(f)])
+        child.expect('ok!')
+        
+
 # XXX probably we need to run all the stuff here in pexpect anyway...
 
 class TestCCurses(object):
@@ -86,4 +97,3 @@
 
         fn = compile(runs_tparm, [])
         fn(expected_extra_mallocs=-1)
-    



More information about the Pypy-commit mailing list