Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_socket.TestLinuxAbstractNamespace Class Reference

List of all members.

Public Member Functions

def testLinuxAbstractNamespace
def testMaxName
def testNameOverflow

Static Public Attributes

int UNIX_PATH_MAX = 108

Detailed Description

Definition at line 1756 of file test_socket.py.


Member Function Documentation

Definition at line 1760 of file test_socket.py.

01760 
01761     def testLinuxAbstractNamespace(self):
01762         address = b"\x00python-test-hello\x00\xff"
01763         with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s1:
01764             s1.bind(address)
01765             s1.listen(1)
01766             with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s2:
01767                 s2.connect(s1.getsockname())
01768                 with s1.accept()[0] as s3:
01769                     self.assertEqual(s1.getsockname(), address)
01770                     self.assertEqual(s2.getpeername(), address)

Here is the call graph for this function:

Definition at line 1771 of file test_socket.py.

01771 
01772     def testMaxName(self):
01773         address = b"\x00" + b"h" * (self.UNIX_PATH_MAX - 1)
01774         with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
01775             s.bind(address)
01776             self.assertEqual(s.getsockname(), address)

Here is the call graph for this function:

Definition at line 1777 of file test_socket.py.

01777 
01778     def testNameOverflow(self):
01779         address = "\x00" + "h" * self.UNIX_PATH_MAX
01780         with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
01781             self.assertRaises(socket.error, s.bind, address)
01782 
01783 
@unittest.skipUnless(thread, 'Threading required for this test.')

Here is the call graph for this function:


Member Data Documentation

Definition at line 1758 of file test_socket.py.


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