From 6dcfc35011208f4bfde7f37a63d7b980f6c41ce0 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Wed, 8 Jul 2015 09:20:25 +0200 Subject: introduce http_semantics module used for generic HTTP representation everything should apply for HTTP/1 and HTTP/2 --- test/test_http.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/test_http.py b/test/test_http.py index 2ad81d24..bbc78847 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -1,7 +1,7 @@ import cStringIO import textwrap import binascii -from netlib import http, odict, tcp +from netlib import http, http_semantics, odict, tcp from . import tutils, tservers @@ -307,13 +307,13 @@ def test_read_response(): data = """ HTTP/1.1 200 OK """ - assert tst(data, "GET", None) == ( + assert tst(data, "GET", None) == http_semantics.Response( (1, 1), 200, 'OK', odict.ODictCaseless(), '' ) data = """ HTTP/1.1 200 """ - assert tst(data, "GET", None) == ( + assert tst(data, "GET", None) == http_semantics.Response( (1, 1), 200, '', odict.ODictCaseless(), '' ) data = """ @@ -330,7 +330,7 @@ def test_read_response(): HTTP/1.1 200 OK """ - assert tst(data, "GET", None) == ( + assert tst(data, "GET", None) == http_semantics.Response( (1, 1), 100, 'CONTINUE', odict.ODictCaseless(), '' ) @@ -340,8 +340,8 @@ def test_read_response(): foo """ - assert tst(data, "GET", None)[4] == 'foo' - assert tst(data, "HEAD", None)[4] == '' + assert tst(data, "GET", None).content == 'foo' + assert tst(data, "HEAD", None).content == '' data = """ HTTP/1.1 200 OK @@ -357,7 +357,7 @@ def test_read_response(): foo """ - assert tst(data, "GET", None, include_body=False)[4] is None + assert tst(data, "GET", None, include_body=False).content is None def test_parse_url(): -- cgit v1.2.3