1 from test
.test_support
import verify
,verbose
6 def __init__(self
, text
):
9 def makefile(self
, mode
, bufsize
=None):
10 if mode
!= 'r' and mode
!= 'rb':
11 raise UnimplementedFileMode()
12 return StringIO
.StringIO(self
.text
)
14 # Test HTTP status lines
16 body
= "HTTP/1.1 200 Ok\r\n\r\nText"
17 sock
= FakeSocket(body
)
18 resp
= httplib
.HTTPResponse(sock
,1)
23 body
= "HTTP/1.1 400.100 Not Ok\r\n\r\nText"
24 sock
= FakeSocket(body
)
25 resp
= httplib
.HTTPResponse(sock
,1)
28 except httplib
.BadStatusLine
:
29 print "BadStatusLine raised as expected"
31 print "Expect BadStatusLine"