#NEWLINE# def test_message_simple( ) : #NEWLINE# #INDENT# raw = 'foobar\r\na: b\r\nContent-Length: 100\r\n\r\n' #NEWLINE# raw += ( 'A' * 100 ) #NEWLINE# m = http . HTTPMessage ( raw ) #NEWLINE# assert m . complete #NEWLINE# assert ( m . malformed == False ) #NEWLINE# assert ( m . start_line == 'foobar' ) #NEWLINE# assert ( raw . body == ( 'A' * 100 ) ) #NEWLINE# assert ( m . headers . all_pairs ( ) == [ ( 'a' , 'b' ) , ( 'Content-Length' , '100' ) ] ) #NEWLINE# assert ( m . headers [ 'A' ] == 'b' ) #NEWLINE# assert ( m . headers_section == 'foobar\r\na: b\r\nContent-Length: 100\r\n\r\n' ) #NEWLINE# assert ( m . full_message == raw )