Commit 18bbfed3 authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

posix.fdopen does not exists any more; and os.fdopen exists on all platforms.

Move tests from test_posix to test_os.
parent 0ac41adc
......@@ -134,6 +134,16 @@ class TemporaryFileTests(unittest.TestCase):
else:
self.check_tempfile(name)
def fdopen_helper(self, *args):
fd = os.open(support.TESTFN, os.O_RDONLY)
fp2 = os.fdopen(fd, *args)
fp2.close()
def test_fdopen(self):
self.fdopen_helper()
self.fdopen_helper('r')
self.fdopen_helper('r', 100)
# Test attributes on return values from os.*stat* family.
class StatAttributeTests(unittest.TestCase):
def setUp(self):
......
......@@ -89,17 +89,6 @@ class PosixTester(unittest.TestCase):
fp1.close()
fp2.close()
def fdopen_helper(self, *args):
fd = os.open(support.TESTFN, os.O_RDONLY)
fp2 = posix.fdopen(fd, *args)
fp2.close()
def test_fdopen(self):
if hasattr(posix, 'fdopen'):
self.fdopen_helper()
self.fdopen_helper('r')
self.fdopen_helper('r', 100)
def test_osexlock(self):
if hasattr(posix, "O_EXLOCK"):
fd = os.open(support.TESTFN,
......
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