Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_fcntl.TestFcntl Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_fcntl_fileno
def test_fcntl_file_descriptor
def test_fcntl_64_bit

Public Attributes

 f

Detailed Description

Definition at line 53 of file test_fcntl.py.


Member Function Documentation

Definition at line 55 of file test_fcntl.py.

00055 
00056     def setUp(self):
00057         self.f = None

Here is the caller graph for this function:

Definition at line 58 of file test_fcntl.py.

00058 
00059     def tearDown(self):
00060         if self.f and not self.f.closed:
00061             self.f.close()
00062         unlink(TESTFN)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 83 of file test_fcntl.py.

00083 
00084     def test_fcntl_64_bit(self):
00085         # Issue #1309352: fcntl shouldn't fail when the third arg fits in a
00086         # C 'long' but not in a C 'int'.
00087         try:
00088             cmd = fcntl.F_NOTIFY
00089             # This flag is larger than 2**31 in 64-bit builds
00090             flags = fcntl.DN_MULTISHOT
00091         except AttributeError:
00092             self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable")
00093         fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY)
00094         try:
00095             fcntl.fcntl(fd, cmd, flags)
00096         finally:
00097             os.close(fd)
00098 

Here is the call graph for this function:

Definition at line 75 of file test_fcntl.py.

00075 
00076     def test_fcntl_file_descriptor(self):
00077         # again, but pass the file rather than numeric descriptor
00078         self.f = open(TESTFN, 'wb')
00079         rv = fcntl.fcntl(self.f, fcntl.F_SETFL, os.O_NONBLOCK)
00080         if sys.platform not in ['os2emx']:
00081             rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata)
00082         self.f.close()

Definition at line 63 of file test_fcntl.py.

00063 
00064     def test_fcntl_fileno(self):
00065         # the example from the library docs
00066         self.f = open(TESTFN, 'wb')
00067         rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
00068         if verbose:
00069             print('Status from fcntl with O_NONBLOCK: ', rv)
00070         if sys.platform not in ['os2emx']:
00071             rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETLKW, lockdata)
00072             if verbose:
00073                 print('String from fcntl with F_SETLKW: ', repr(rv))
00074         self.f.close()


Member Data Documentation

Definition at line 56 of file test_fcntl.py.


The documentation for this class was generated from the following file: