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:
Skip Montanaro 2006-04-20 01:29:48 +00:00
parent d0b8e83dc5
commit 94785ef142
3 changed files with 17 additions and 9 deletions

View file

@ -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)