diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2016-06-04 12:06:26 -0700 |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2016-06-04 12:06:26 -0700 |
commit | 410ef8e23088ab2b8bd92ac70a8176f71da2b931 (patch) | |
tree | dceeb23e4a2dcddecc72e0bc6faa15a1177ab633 /Lib/test/test_os.py | |
parent | c55014f3717ce8a810a7e934c8ad5b519dbf88c5 (diff) | |
download | cpython-git-410ef8e23088ab2b8bd92ac70a8176f71da2b931.tar.gz |
issue27186: add C version of os.fspath(); patch by Jelle Zijlstra
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 84ef150f82..bf06438db2 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -3121,6 +3121,13 @@ class TestPEP519(unittest.TestCase): self.assertEqual(b"path/like/object", os.fsencode(pathlike)) self.assertEqual("path/like/object", os.fsdecode(pathlike)) + def test_fspathlike(self): + class PathLike(object): + def __fspath__(self): + return '#feelthegil' + + self.assertEqual('#feelthegil', os.fspath(PathLike())) + def test_garbage_in_exception_out(self): vapor = type('blah', (), {}) for o in int, type, os, vapor(): |