Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_httplib.SourceAddressTest Class Reference
Inheritance diagram for test.test_httplib.SourceAddressTest:
Inheritance graph
Collaboration diagram for test.test_httplib.SourceAddressTest:
Collaboration graph

List of all members.

Public Member Functions

def setUp
def tearDown
def testHTTPConnectionSourceAddress
def testHTTPSConnectionSourceAddress

Public Attributes


Detailed Description

Definition at line 375 of file

Member Function Documentation

Definition at line 376 of file

00377     def setUp(self):
00378         self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
00379         self.port = support.bind_port(self.serv)
00380         self.source_port = support.find_unused_port()
00381         self.serv.listen(5)
00382         self.conn = None

Here is the caller graph for this function:

Definition at line 383 of file

00384     def tearDown(self):
00385         if self.conn:
00386             self.conn.close()
00387             self.conn = None
00388         self.serv.close()
00389         self.serv = None

Here is the caller graph for this function:

Definition at line 390 of file

00391     def testHTTPConnectionSourceAddress(self):
00392         self.conn = client.HTTPConnection(HOST, self.port,
00393                 source_address=('', self.source_port))
00394         self.conn.connect()
00395         self.assertEqual(self.conn.sock.getsockname()[1], self.source_port)

Here is the call graph for this function:

Definition at line 398 of file

00399     def testHTTPSConnectionSourceAddress(self):
00400         self.conn = client.HTTPSConnection(HOST, self.port,
00401                 source_address=('', self.source_port))
00402         # We don't test anything here other the constructor not barfing as
00403         # this code doesn't deal with setting up an active running SSL server
00404         # for an ssl_wrapped connect() to actually return from.

Member Data Documentation

Definition at line 381 of file

Definition at line 378 of file

Definition at line 377 of file

Definition at line 379 of file

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