mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Correct implementation and documentation of os.confstr. Add a simple test
case. I've yet to figure out how to provoke a None return I can test.
This commit is contained in:
parent
d0b8e83dc5
commit
94785ef142
3 changed files with 17 additions and 9 deletions
|
|
@ -73,6 +73,11 @@ class PosixTester(unittest.TestCase):
|
|||
finally:
|
||||
fp.close()
|
||||
|
||||
def test_confstr(self):
|
||||
if hasattr(posix, 'confstr'):
|
||||
self.assertRaises(ValueError, posix.confstr, "CS_garbage")
|
||||
self.assertEqual(len(posix.confstr("CS_PATH")) > 0, True)
|
||||
|
||||
def test_dup2(self):
|
||||
if hasattr(posix, 'dup2'):
|
||||
fp1 = open(test_support.TESTFN)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue