[Python-checkins] r81014 - python/branches/py3k/Lib/test/test_os.py

victor.stinner python-checkins at python.org
Sun May 9 05:15:34 CEST 2010


Author: victor.stinner
Date: Sun May  9 05:15:33 2010
New Revision: 81014

Log:
Write tests for the new function os.fsencode()


Modified:
   python/branches/py3k/Lib/test/test_os.py

Modified: python/branches/py3k/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k/Lib/test/test_os.py	(original)
+++ python/branches/py3k/Lib/test/test_os.py	Sun May  9 05:15:33 2010
@@ -937,6 +937,13 @@
         self._kill_with_event(signal.CTRL_BREAK_EVENT, "CTRL_BREAK_EVENT")
 
 
+class MiscTests(unittest.TestCase):
+    @unittest.skipIf(sys.platform == "win32", "POSIX specific test")
+    def test_fsencode(self):
+        self.assertEquals(os.fsencode(b'ab\xff'), b'ab\xff')
+        self.assertEquals(os.fsencode('ab\uDCFF'), b'ab\xff')
+
+
 def test_main():
     support.run_unittest(
         FileTests,
@@ -951,7 +958,8 @@
         TestInvalidFD,
         PosixUidGidTests,
         Pep383Tests,
-        Win32KillTests
+        Win32KillTests,
+        MiscTests,
     )
 
 if __name__ == "__main__":


More information about the Python-checkins mailing list