[pypy-svn] r76243 - pypy/branch/unicode_filename-2/pypy/rlib/test

afa at codespeak.net afa at codespeak.net
Thu Jul 15 22:14:05 CEST 2010


Author: afa
Date: Thu Jul 15 22:14:03 2010
New Revision: 76243

Modified:
   pypy/branch/unicode_filename-2/pypy/rlib/test/test_rposix.py
Log:
Fix test on Linux


Modified: pypy/branch/unicode_filename-2/pypy/rlib/test/test_rposix.py
==============================================================================
--- pypy/branch/unicode_filename-2/pypy/rlib/test/test_rposix.py	(original)
+++ pypy/branch/unicode_filename-2/pypy/rlib/test/test_rposix.py	Thu Jul 15 22:14:03 2010
@@ -90,11 +90,18 @@
 
     def test_listdir(self):
         udir = UnicodeWithEncoding(os.path.dirname(self.ufilename))
-        def f():
-            return u', '.join(rposix.listdir(udir))
 
-        result = interpret(f, [])
-        assert os.path.basename(self.ufilename) in ll_to_string(result)
+        if sys.platform == 'win32':
+            def f():
+                return u', '.join(rposix.listdir(udir))
+            result = interpret(f, [])
+            assert os.path.basename(self.ufilename) in ll_to_string(result)
+        else:
+            def f():
+                return ', '.join(rposix.listdir(udir))
+            result = interpret(f, [])
+            assert (os.path.basename(self.ufilename).encode('utf-8') in
+                    ll_to_string(result))
 
     def test_chdir(self):
         os.unlink(self.ufilename)



More information about the Pypy-commit mailing list