diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-09 03:15:33 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-09 03:15:33 (GMT) |
commit | bf9bcab98e194780f11ccd59803cb2bb71752e83 (patch) | |
tree | 81db7681e2a226be87d40f79e2668b54da3876da /Lib/test | |
parent | 09fe64cdf9e61ba71523d653755a29b6a4f040d5 (diff) | |
download | cpython-bf9bcab98e194780f11ccd59803cb2bb71752e83.zip cpython-bf9bcab98e194780f11ccd59803cb2bb71752e83.tar.gz cpython-bf9bcab98e194780f11ccd59803cb2bb71752e83.tar.bz2 |
Write tests for the new function os.fsencode()
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_os.py | 10 |
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__": |