def test_assemble_request(): assert assemble_request(treq()) == (b"GET /path HTTP/1.1\r\n" b"header: qvalue\r\n" b"content-length: 7\r\n" b"host: address:22\r\n" b"\r\n" b"content") with raises(HttpException): assemble_request(treq(content=None))
def test_assemble_request(): c = assemble_request(treq()) == (b"GET /path HTTP/1.1\r\n" b"header: qvalue\r\n" b"Host: address:22\r\n" b"Content-Length: 7\r\n" b"\r\n" b"content") with raises(HttpException): assemble_request(treq(content=CONTENT_MISSING))
def test_assemble_request(): c = assemble_request(treq()) == ( b"GET /path HTTP/1.1\r\n" b"header: qvalue\r\n" b"Host: address:22\r\n" b"Content-Length: 7\r\n" b"\r\n" b"content" ) with raises(HttpException): assemble_request(treq(content=CONTENT_MISSING))
def test_assemble_request(): assert assemble_request(treq()) == ( b"GET /path HTTP/1.1\r\n" b"header: qvalue\r\n" b"content-length: 7\r\n" b"host: address:22\r\n" b"\r\n" b"content" ) with raises(HttpException): assemble_request(treq(content=None))
def response(context, flow): print("================================================================") print(flow.request.url + ' ' + datetime.now().strftime("%Y/%m/%d %H:%M:%S")) print("================================================================") print(assemble.assemble_request(flow.request)) print("================================================================") print(assemble.assemble_response(flow.response)) print("================================================================")