示例#1
0
def create_html_parser(monkeypatch, content_type):
    class HTMLParser(object):
        def __init__(self, **kw):
            self.kw = kw
    monkeypatch.setattr(e, 'HTMLParser', HTMLParser)
    lines = [content_type, b'', b'']
    CRLF = b'\r\n'
    headers = parse_headers(BytesIO(CRLF.join(lines)))
    return e.create_html_parser(headers)
示例#2
0
def create_html_parser_with_content_type(monkeypatch, content_type):
    class HTMLParser(object):
        def __init__(self, **kw):
            self.kw = kw
    monkeypatch.setattr('wex.form.HTMLParser', HTMLParser)
    lines = [content_type, b'', b'']
    CRLF = b'\r\n'
    headers = parse_headers(BytesIO(CRLF.join(lines)))
    return create_html_parser(headers)
示例#3
0
 def __init__(self):
     self.headers = parse_headers(BytesIO())
     self.url = None
示例#4
0
 def __init__(self):
     self.headers = parse_headers(BytesIO())
     self.url = None