Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_fcntl Namespace Reference

Classes

class  TestFcntl

Functions

def get_lockdata
def test_main

Variables

tuple fcntl = import_module('fcntl')
tuple lockdata = get_lockdata()

Detailed Description

Test program for the fcntl C module.

OS/2+EMX doesn't support the file locking operations.

Function Documentation

Definition at line 18 of file test_fcntl.py.

00018 
00019 def get_lockdata():
00020     try:
00021         os.O_LARGEFILE
00022     except AttributeError:
00023         start_len = "ll"
00024     else:
00025         start_len = "qq"
00026 
00027     if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3',
00028                         'Darwin1.2', 'darwin',
00029                         'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
00030                         'freebsd6', 'freebsd7', 'freebsd8',
00031                         'bsdos2', 'bsdos3', 'bsdos4',
00032                         'openbsd', 'openbsd2', 'openbsd3', 'openbsd4'):
00033         if struct.calcsize('l') == 8:
00034             off_t = 'l'
00035             pid_t = 'i'
00036         else:
00037             off_t = 'lxxxx'
00038             pid_t = 'l'
00039         lockdata = struct.pack(off_t + off_t + pid_t + 'hh', 0, 0, 0,
00040                                fcntl.F_WRLCK, 0)
00041     elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']:
00042         lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
00043     elif sys.platform in ['os2emx']:
00044         lockdata = None
00045     else:
00046         lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
00047     if lockdata:
00048         if verbose:
00049             print('struct.pack: ', repr(lockdata))
00050     return lockdata

Definition at line 99 of file test_fcntl.py.

00099 
00100 def test_main():
00101     run_unittest(TestFcntl)

Here is the call graph for this function:


Variable Documentation

tuple test.test_fcntl.fcntl = import_module('fcntl')

Definition at line 13 of file test_fcntl.py.

Definition at line 51 of file test_fcntl.py.