Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_httplib.HTTPResponseTest Class Reference
Inheritance diagram for test.test_httplib.HTTPResponseTest:
Inheritance graph
[legend]
Collaboration diagram for test.test_httplib.HTTPResponseTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_getting_header
def test_getting_nonexistent_header_with_string_default
def test_getting_nonexistent_header_with_iterable_default
def test_getting_nonexistent_header_without_default
def test_getting_header_defaultint

Public Attributes

 resp

Detailed Description

Definition at line 613 of file test_httplib.py.


Member Function Documentation

Definition at line 615 of file test_httplib.py.

00615 
00616     def setUp(self):
00617         body = "HTTP/1.1 200 Ok\r\nMy-Header: first-value\r\nMy-Header: \
00618                 second-value\r\n\r\nText"
00619         sock = FakeSocket(body)
00620         self.resp = client.HTTPResponse(sock)
00621         self.resp.begin()

Here is the caller graph for this function:

Definition at line 622 of file test_httplib.py.

00622 
00623     def test_getting_header(self):
00624         header = self.resp.getheader('My-Header')
00625         self.assertEqual(header, 'first-value, second-value')
00626 
00627         header = self.resp.getheader('My-Header', 'some default')
00628         self.assertEqual(header, 'first-value, second-value')

Here is the call graph for this function:

Definition at line 644 of file test_httplib.py.

00644 
00645     def test_getting_header_defaultint(self):
00646         header = self.resp.getheader('No-Such-Header',default=42)
00647         self.assertEqual(header, 42)

Here is the call graph for this function:

Definition at line 633 of file test_httplib.py.

00633 
00634     def test_getting_nonexistent_header_with_iterable_default(self):
00635         header = self.resp.getheader('No-Such-Header', ['default', 'values'])
00636         self.assertEqual(header, 'default, values')
00637 
00638         header = self.resp.getheader('No-Such-Header', ('default', 'values'))
00639         self.assertEqual(header, 'default, values')

Here is the call graph for this function:

Definition at line 629 of file test_httplib.py.

00629 
00630     def test_getting_nonexistent_header_with_string_default(self):
00631         header = self.resp.getheader('No-Such-Header', 'default-value')
00632         self.assertEqual(header, 'default-value')

Here is the call graph for this function:

Definition at line 640 of file test_httplib.py.

00640 
00641     def test_getting_nonexistent_header_without_default(self):
00642         header = self.resp.getheader('No-Such-Header')
00643         self.assertEqual(header, None)

Here is the call graph for this function:


Member Data Documentation

Definition at line 619 of file test_httplib.py.


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