mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Write tests for the new function os.fsencode()
This commit is contained in:
parent
09fe64cdf9
commit
bf9bcab98e
1 changed files with 9 additions and 1 deletions
|
@ -937,6 +937,13 @@ class Win32KillTests(unittest.TestCase):
|
||||||
self._kill_with_event(signal.CTRL_BREAK_EVENT, "CTRL_BREAK_EVENT")
|
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():
|
def test_main():
|
||||||
support.run_unittest(
|
support.run_unittest(
|
||||||
FileTests,
|
FileTests,
|
||||||
|
@ -951,7 +958,8 @@ def test_main():
|
||||||
TestInvalidFD,
|
TestInvalidFD,
|
||||||
PosixUidGidTests,
|
PosixUidGidTests,
|
||||||
Pep383Tests,
|
Pep383Tests,
|
||||||
Win32KillTests
|
Win32KillTests,
|
||||||
|
MiscTests,
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue