[pypy-svn] r74349 - pypy/trunk/pypy/module/posix/test

arigo at codespeak.net arigo at codespeak.net
Mon May 3 17:31:10 CEST 2010


Author: arigo
Date: Mon May  3 17:31:08 2010
New Revision: 74349

Modified:
   pypy/trunk/pypy/module/posix/test/test_posix2.py
Log:
Windows fixes.


Modified: pypy/trunk/pypy/module/posix/test/test_posix2.py
==============================================================================
--- pypy/trunk/pypy/module/posix/test/test_posix2.py	(original)
+++ pypy/trunk/pypy/module/posix/test/test_posix2.py	Mon May  3 17:31:08 2010
@@ -180,16 +180,18 @@
             assert 0
 
     def test_filename_exception(self):
-        for fn in [self.posix.unlink, self.posix.remove,
-                   self.posix.chdir, self.posix.mkdir, self.posix.rmdir,
-                   self.posix.listdir, self.posix.readlink,
-                   self.posix.chroot]:
-            try:
-                fn('qowieuqw/oeiu')
-            except OSError, e:
-                assert e.filename == 'qowieuqw/oeiu'
-            else:
-                assert 0
+        for fname in ['unlink', 'remove',
+                      'chdir', 'mkdir', 'rmdir',
+                      'listdir', 'readlink',
+                      'chroot']:
+            if hasattr(self.posix, fname):
+                func = getattr(self.posix, fname)
+                try:
+                    func('qowieuqw/oeiu')
+                except OSError, e:
+                    assert e.filename == 'qowieuqw/oeiu'
+                else:
+                    assert 0
 
     def test_chmod_exception(self):
         try:
@@ -200,12 +202,13 @@
             assert 0
 
     def test_chown_exception(self):
-        try:
-            self.posix.chown('qowieuqw/oeiu', 0, 0)
-        except OSError, e:
-            assert e.filename == 'qowieuqw/oeiu'
-        else:
-            assert 0
+        if hasattr(self.posix, 'chown'):
+            try:
+                self.posix.chown('qowieuqw/oeiu', 0, 0)
+            except OSError, e:
+                assert e.filename == 'qowieuqw/oeiu'
+            else:
+                assert 0
 
     def test_utime_exception(self):
         for arg in [None, (0, 0)]:



More information about the Pypy-commit mailing list