Пример #1
0
def test_strerror():
    test_dict = {
        0: 'No error',
        1: 'Operation not permitted',
        2: 'No such file or directory',
        3: 'No such process',
        4: 'Interrupted function call',
        5: 'Input/output error',
        6: 'No such device or address',
        7: 'Arg list too long',
        8: 'Exec format error',
        9: 'Bad file descriptor',
        10: 'No child processes',
        11: 'Resource temporarily unavailable',
        12: 'Not enough space',
        13: 'Permission denied',
        14: 'Bad address',
        16: 'Resource device',
        17: 'File exists',
        18: 'Improper link',
        19: 'No such device',
        20: 'Not a directory',
        21: 'Is a directory',
        22: 'Invalid argument',
        23: 'Too many open files in system',
        24: 'Too many open files',
        25: 'Inappropriate I/O control operation',
        27: 'File too large',
        28: 'No space left on device',
        29: 'Invalid seek',
        30: 'Read-only file system',
        31: 'Too many links',
        32: 'Broken pipe',
        33: 'Domain error',
        34: 'Result too large',
        36: 'Resource deadlock avoided',
        38: 'Filename too long',
        39: 'No locks available',
        40: 'Function not implemented',
        41: 'Directory not empty',
        42: 'Illegal byte sequence'
    }

    for key, value in test_dict.items():
        AreEqual(nt.strerror(key), value)
Пример #2
0
def test_strerror():
    test_dict = {
        0: "No error",
        1: "Operation not permitted",
        2: "No such file or directory",
        3: "No such process",
        4: "Interrupted function call",
        5: "Input/output error",
        6: "No such device or address",
        7: "Arg list too long",
        8: "Exec format error",
        9: "Bad file descriptor",
        10: "No child processes",
        11: "Resource temporarily unavailable",
        12: "Not enough space",
        13: "Permission denied",
        14: "Bad address",
        16: "Resource device",
        17: "File exists",
        18: "Improper link",
        19: "No such device",
        20: "Not a directory",
        21: "Is a directory",
        22: "Invalid argument",
        23: "Too many open files in system",
        24: "Too many open files",
        25: "Inappropriate I/O control operation",
        27: "File too large",
        28: "No space left on device",
        29: "Invalid seek",
        30: "Read-only file system",
        31: "Too many links",
        32: "Broken pipe",
        33: "Domain error",
        34: "Result too large",
        36: "Resource deadlock avoided",
        38: "Filename too long",
        39: "No locks available",
        40: "Function not implemented",
        41: "Directory not empty",
        42: "Illegal byte sequence",
    }

    for key, value in test_dict.iteritems():
        AreEqual(nt.strerror(key), value)
Пример #3
0
def test_strerror():
    test_dict = {
                    0: 'No error',
                    1: 'Operation not permitted', 
                    2: 'No such file or directory', 
                    3: 'No such process', 
                    4: 'Interrupted function call', 
                    5: 'Input/output error', 
                    6: 'No such device or address', 
                    7: 'Arg list too long', 
                    8: 'Exec format error', 
                    9: 'Bad file descriptor', 
                    10: 'No child processes', 
                    11: 'Resource temporarily unavailable', 
                    12: 'Not enough space', 
                    13: 'Permission denied', 
                    14: 'Bad address', 
                    16: 'Resource device', 
                    17: 'File exists', 
                    18: 'Improper link', 
                    19: 'No such device', 
                    20: 'Not a directory', 
                    21: 'Is a directory', 
                    22: 'Invalid argument', 
                    23: 'Too many open files in system', 
                    24: 'Too many open files', 
                    25: 'Inappropriate I/O control operation', 
                    27: 'File too large', 
                    28: 'No space left on device', 
                    29: 'Invalid seek', 
                    30: 'Read-only file system', 
                    31: 'Too many links', 
                    32: 'Broken pipe', 
                    33: 'Domain error', 
                    34: 'Result too large', 
                    36: 'Resource deadlock avoided', 
                    38: 'Filename too long', 
                    39: 'No locks available', 
                    40: 'Function not implemented', 
                    41: 'Directory not empty', 42: 'Illegal byte sequence'
                    }
                    
    for key, value in test_dict.iteritems():
        AreEqual(nt.strerror(key), value)