summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-09 03:15:33 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-09 03:15:33 (GMT)
commitbf9bcab98e194780f11ccd59803cb2bb71752e83 (patch)
tree81db7681e2a226be87d40f79e2668b54da3876da
parent09fe64cdf9e61ba71523d653755a29b6a4f040d5 (diff)
downloadcpython-bf9bcab98e194780f11ccd59803cb2bb71752e83.zip
cpython-bf9bcab98e194780f11ccd59803cb2bb71752e83.tar.gz
cpython-bf9bcab98e194780f11ccd59803cb2bb71752e83.tar.bz2
Write tests for the new function os.fsencode()
-rw-r--r--Lib/test/test_os.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 453b058..7fb4376 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -937,6 +937,13 @@ class Win32KillTests(unittest.TestCase):
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 @@ def test_main():
TestInvalidFD,
PosixUidGidTests,
Pep383Tests,
- Win32KillTests
+ Win32KillTests,
+ MiscTests,
)
if __name__ == "__main__":