diff --git a/tests/002-test-request.py b/tests/002-test-request.py index 3fda0ff0..ef6140f0 100644 --- a/tests/002-test-request.py +++ b/tests/002-test-request.py @@ -23,20 +23,14 @@ def test_001(req): t.eq(body, '{"nom": "nom"}') @t.http_request("002.http") -def http_request(req): +def test_002(req): e = req.read() - t.eq(e['REQUEST_METHOD'], 'GET') t.eq(e['PATH_INFO'], "/test") t.eq(e['QUERY_STRING'], "") - t.eq(sorted(p.headers), [ - ("Accept", "*/*"), - ("Host", "0.0.0.0=5000"), - ("User-Agent", "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1") - ]) t.eq(e['HTTP_ACCEPT'], "*/*") t.eq(e['HTTP_HOST'], "0.0.0.0=5000") - t.eq(e['HTTP_USER_AGENT', "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1"]) + t.eq(e['HTTP_USER_AGENT'], "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1") body = e['wsgi.input'].read() t.eq(body, '') diff --git a/tests/t.py b/tests/t.py index af7e0c94..9f83584e 100644 --- a/tests/t.py +++ b/tests/t.py @@ -69,7 +69,7 @@ class http_request(object): def run(): fsock = FakeSocket(data_source(self.fname)) req = HttpRequest(fsock, ('127.0.0.1', 6000), - ('127.0.0.1', 8000)) + ('127.0.0.1', 8000)) func(req) run.func_name = func.func_name return run