[pypy-svn] r46291 - pypy/branch/pypy-more-rtti-inprogress/rpython/module/test

arigo at codespeak.net arigo at codespeak.net
Mon Sep 3 18:32:31 CEST 2007


Author: arigo
Date: Mon Sep  3 18:32:30 2007
New Revision: 46291

Modified:
   pypy/branch/pypy-more-rtti-inprogress/rpython/module/test/test_posix.py
Log:
Fix tests.


Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/module/test/test_posix.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/module/test/test_posix.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/module/test/test_posix.py	Mon Sep  3 18:32:30 2007
@@ -104,20 +104,19 @@
         res = self.interpret(f,[fi])
         raises( OSError, os.fstat, fi)
 
-    def test_ftruncate(self):
-        def f(fi,len):
-            posix.ftruncate(fi,len)
-        fi = os.open(path,os.O_RDWR,0777)
-        func = self.interpret(f,[fi,6]) 
-        assert os.fstat(fi).st_size == 6
-
-    def test_getuid(self):
-        def f():
-            return os.getuid()
-        assert self.interpret(f, []) == f()
-
-if not hasattr(os, 'ftruncate'):
-    del BaseTestPosix.test_ftruncate
+    if hasattr(os, 'ftruncate'):
+        def test_ftruncate(self):
+            def f(fi,len):
+                os.ftruncate(fi,len)
+            fi = os.open(path,os.O_RDWR,0777)
+            func = self.interpret(f,[fi,6]) 
+            assert os.fstat(fi).st_size == 6
+
+    if hasattr(os, 'getuid'):
+        def test_getuid(self):
+            def f():
+                return os.getuid()
+            assert self.interpret(f, []) == f()
 
 class TestLLtype(BaseTestPosix, LLRtypeMixin):
     if False and hasattr(os, 'uname'):



More information about the Pypy-commit mailing list