Commit bf9bcab9 authored by Victor Stinner's avatar Victor Stinner

Write tests for the new function os.fsencode()

parent 09fe64cd
......@@ -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__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment