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)
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)
def __init__(self): self.headers = parse_headers(BytesIO()) self.url = None
def __init__(self): self.headers = parse_headers(BytesIO()) self.url = None