def test_error4(): """Wrong number of elements returned in response line""" with pytest.raises(errors.TestError): http_ua = http.HttpUA() response = http.HttpResponse("HTTP1.1 OK\r\n", http_ua)
def test_error3(): """Invalid status returned in response line""" http_ua = http.HttpUA() with pytest.raises(errors.TestError): response = http.HttpResponse("HTTP1.1 test OK\r\n", http_ua)
def test_error6(): """Valid HTTP response should process fine""" http_ua = http.HttpUA() response = http.HttpResponse("HTTP/1.1 200 OK\r\ntest: hello\r\n", http_ua)
def test_error7(): """Invalid content-type should fail""" http_ua = http.HttpUA() with pytest.raises(errors.TestError): response = http.HttpResponse( "HTTP/1.1 200 OK\r\nContent-Encoding: XYZ\r\n", http_ua)
def test_error5(): """Invalid Header should cause error""" http_ua = http.HttpUA() with pytest.raises(errors.TestError): response = http.HttpResponse("HTTP/1.1 200 OK\r\ntest\r\n", http_ua)