def assert_header_parsing(headers):
 if (not isinstance(headers, httplib.HTTPMessage)):
  raise TypeError('expected httplib.Message, got {0}.'.format(type(headers)))
 defects = getattr(headers, 'defects', None)
 get_payload = getattr(headers, 'get_payload', None)
 unparsed_data = None
 if get_payload:
  unparsed_data = get_payload()
 if (defects or unparsed_data):
  raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)

def assert_header_parsing ( headers ) : if ( not isinstance ( headers , httplib . HTTPMessage ) ) : raise TypeError ( 'expected httplib.Message, got {0}.' . format ( type ( headers ) ) ) defects = getattr ( headers , 'defects' , None ) get_payload = getattr ( headers , 'get_payload' , None ) unparsed_data = None if get_payload : unparsed_data = get_payload ( ) if ( defects or unparsed_data ) : raise HeaderParsingError ( defects = defects , unparsed_data = unparsed_data )
asserts whether all headers have been successfully parsed .