diff --git a/httpretty/http.py b/httpretty/http.py index d18b8d9..388a73a 100644 --- a/httpretty/http.py +++ b/httpretty/http.py @@ -116,7 +116,8 @@ class HttpBaseClass(BaseClass): HEAD = b'HEAD' PATCH = b'PATCH' OPTIONS = b'OPTIONS' - METHODS = (GET, PUT, POST, DELETE, HEAD, PATCH, OPTIONS) + CONNECT = b'CONNECT' + METHODS = (GET, PUT, POST, DELETE, HEAD, PATCH, OPTIONS, CONNECT) def parse_requestline(s): diff --git a/tests/unit/test_http.py b/tests/unit/test_http.py new file mode 100644 index 0000000..7ea5fe1 --- /dev/null +++ b/tests/unit/test_http.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from httpretty.http import parse_requestline + + +def test_parse_request_line_connect(): + ("parse_requestline should parse the CONNECT method appropriately") + + # Given a valid request line string that has the CONNECT method + line = "CONNECT / HTTP/1.1" + + # When I parse it + result = parse_requestline(line) + + # Then it should return a tuple + result.should.equal(("CONNECT", "/", "1.1"))