aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-09 03:15:33 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-09 03:15:33 +0000
commitbf9bcab98e194780f11ccd59803cb2bb71752e83 (patch)
tree81db7681e2a226be87d40f79e2668b54da3876da /Lib
parent09fe64cdf9e61ba71523d653755a29b6a4f040d5 (diff)
downloadcpython3-bf9bcab98e194780f11ccd59803cb2bb71752e83.tar.gz
Write tests for the new function os.fsencode()
Diffstat (limited to 'Lib')
-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 453b05836d..7fb4376390 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__":