diff options
-rw-r--r-- | test/python/ctx_iter_atexit/wsgi.py | 1 | ||||
-rw-r--r-- | test/test_access_log.py | 22 | ||||
-rw-r--r-- | test/test_asgi_application.py | 45 | ||||
-rw-r--r-- | test/test_configuration.py | 12 | ||||
-rw-r--r-- | test/test_go_application.py | 12 | ||||
-rw-r--r-- | test/test_node_application.py | 11 | ||||
-rw-r--r-- | test/test_php_application.py | 11 | ||||
-rw-r--r-- | test/test_proxy.py | 4 | ||||
-rw-r--r-- | test/test_python_application.py | 44 | ||||
-rw-r--r-- | test/test_ruby_application.py | 11 | ||||
-rw-r--r-- | test/test_tls.py | 17 |
11 files changed, 19 insertions, 171 deletions
diff --git a/test/python/ctx_iter_atexit/wsgi.py b/test/python/ctx_iter_atexit/wsgi.py index b2f12c35..75d40895 100644 --- a/test/python/ctx_iter_atexit/wsgi.py +++ b/test/python/ctx_iter_atexit/wsgi.py @@ -15,7 +15,6 @@ class application: self.start( '200', [ - ('Content-Type', self.environ.get('CONTENT_TYPE')), ('Content-Length', str(len(body))), ], ) diff --git a/test/test_access_log.py b/test/test_access_log.py index f7343d21..b1d89343 100644 --- a/test/test_access_log.py +++ b/test/test_access_log.py @@ -36,7 +36,6 @@ class TestAccessLog(TestApplicationPython): headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body='01234', @@ -47,15 +46,7 @@ class TestAccessLog(TestApplicationPython): self.wait_for_record(r'"POST / HTTP/1.1" 200 5') is not None ), 'keepalive 1' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body='0123456789', - ) + resp = self.post(sock=sock, body='0123456789') assert ( self.wait_for_record(r'"POST / HTTP/1.1" 200 10') is not None @@ -315,16 +306,7 @@ Connection: close self.set_format('$uri $body_bytes_sent') body = '0123456789' * 50 - self.post( - url='/bbs', - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - body=body, - read_timeout=1, - ) + self.post(url='/bbs', body=body, read_timeout=1) assert ( self.wait_for_record(r'^\/bbs ' + str(len(body)) + r'$') is not None ), '$body_bytes_sent' diff --git a/test/test_asgi_application.py b/test/test_asgi_application.py index 534bd3c0..34dfe18e 100644 --- a/test/test_asgi_application.py +++ b/test/test_asgi_application.py @@ -160,15 +160,7 @@ custom-header: BLAH assert self.get()['status'] == 200, 'init' body = '0123456789AB' * 1024 * 1024 # 12 Mb - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - body=body, - read_buffer_size=1024 * 1024, - ) + resp = self.post(body=body, read_buffer_size=1024 * 1024) assert resp['body'] == body, 'keep-alive 1' @@ -182,7 +174,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -192,15 +183,7 @@ custom-header: BLAH assert resp['body'] == body, 'keep-alive 1' body = '0123456789' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body=body, - ) + resp = self.post(sock=sock, body=body) assert resp['body'] == body, 'keep-alive 2' @@ -218,7 +201,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -236,7 +218,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, sock=socks[i], @@ -249,15 +230,7 @@ custom-header: BLAH self.load('mirror', processes=i + 1) for i in range(conns): - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=socks[i], - body=body, - ) + resp = self.post(sock=socks[i], body=body) assert resp['body'] == body, 'keep-alive close' @@ -274,7 +247,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -287,16 +259,7 @@ custom-header: BLAH assert self.get()['status'] == 200, 'init' - (resp, sock) = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - start=True, - sock=sock, - body=body, - ) + (resp, sock) = self.post(start=True, sock=sock, body=body) assert resp['status'] == 200, 'reconfigure 2 keep-alive 2' assert resp['body'] == '', 'reconfigure 2 keep-alive 2 body' diff --git a/test/test_configuration.py b/test/test_configuration.py index 75fbb845..7c612db0 100644 --- a/test/test_configuration.py +++ b/test/test_configuration.py @@ -229,18 +229,12 @@ class TestConfiguration(TestControl): def test_listeners_unix_abstract(self): if option.system != 'Linux': - assert 'error' in self.conf( - {"unix:@sock": {"pass": "routes"}}, 'listeners' - ), 'unix abstract at' + assert 'error' in self.try_addr("unix:@sock"), 'abstract at' pytest.skip('not yet') - assert 'error' in self.conf( - {"unix:\0sock": {"pass": "routes"}}, 'listeners' - ), 'unix abstract zero' - assert 'error' in self.conf( - {"unix:\u0000sock": {"pass": "routes"}}, 'listeners' - ), 'unix abstract zero unicode' + assert 'error' in self.try_addr("unix:\0soc"), 'abstract \0' + assert 'error' in self.try_addr("unix:\u0000soc"), 'abstract \0 unicode' def test_listeners_addr(self): assert 'success' in self.try_addr("*:7080"), 'wildcard' diff --git a/test/test_go_application.py b/test/test_go_application.py index c8cf3e53..a746c6f4 100644 --- a/test/test_go_application.py +++ b/test/test_go_application.py @@ -95,7 +95,6 @@ class TestGoApplication(TestApplicationGo): headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -105,16 +104,7 @@ class TestGoApplication(TestApplicationGo): assert resp['body'] == body, 'keep-alive 1' body = '0123456789' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Content-Type': 'text/html', - 'Connection': 'close', - }, - sock=sock, - body=body, - ) - + resp = self.post(sock=sock, body=body) assert resp['body'] == body, 'keep-alive 2' def test_go_application_cookies(self): diff --git a/test/test_node_application.py b/test/test_node_application.py index fc722582..c26c72d0 100644 --- a/test/test_node_application.py +++ b/test/test_node_application.py @@ -124,7 +124,6 @@ class TestNodeApplication(TestApplicationNode): headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -134,15 +133,7 @@ class TestNodeApplication(TestApplicationNode): assert resp['body'] == '0123456789' * 500, 'keep-alive 1' body = '0123456789' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body=body, - ) + resp = self.post(sock=sock, body=body) assert resp['body'] == body, 'keep-alive 2' diff --git a/test/test_php_application.py b/test/test_php_application.py index 606ac723..f1dcc995 100644 --- a/test/test_php_application.py +++ b/test/test_php_application.py @@ -226,7 +226,6 @@ opcache.preload_user = %(user)s headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -236,15 +235,7 @@ opcache.preload_user = %(user)s assert resp['body'] == body, 'keep-alive 1' body = '0123456789' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body=body, - ) + resp = self.post(sock=sock, body=body) assert resp['body'] == body, 'keep-alive 2' diff --git a/test/test_proxy.py b/test/test_proxy.py index 68ae2394..b0d471e4 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -370,7 +370,6 @@ Content-Length: 10 resp = self.post_http10( headers={ 'Host': 'localhost', - 'Content-Type': 'text/html', 'Content-Length': str(len(body)), 'X-Parts': '2', 'X-Delay': '1', @@ -384,7 +383,6 @@ Content-Length: 10 resp = self.post_http10( headers={ 'Host': 'localhost', - 'Content-Type': 'text/html', 'Content-Length': str(len(body)), 'X-Parts': '2', 'X-Delay': '1', @@ -403,7 +401,6 @@ Content-Length: 10 _, sock = self.post_http10( headers={ 'Host': 'localhost', - 'Content-Type': 'text/html', 'Content-Length': '10000', 'X-Parts': '3', 'X-Delay': '1', @@ -419,7 +416,6 @@ Content-Length: 10 _, sock = self.post_http10( headers={ 'Host': 'localhost', - 'Content-Type': 'text/html', 'Content-Length': '10000', 'X-Parts': '3', 'X-Delay': '1', diff --git a/test/test_python_application.py b/test/test_python_application.py index befbd4d8..2ea9a22e 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -138,14 +138,7 @@ custom-header: BLAH def test_python_application_ctx_iter_atexit(self): self.load('ctx_iter_atexit') - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - body='0123456789', - ) + resp = self.post(body='0123456789') assert resp['status'] == 200, 'ctx iter status' assert resp['body'] == '0123456789', 'ctx iter body' @@ -166,7 +159,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -176,15 +168,7 @@ custom-header: BLAH assert resp['body'] == body, 'keep-alive 1' body = '0123456789' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body=body, - ) + resp = self.post(sock=sock, body=body) assert resp['body'] == body, 'keep-alive 2' @@ -202,7 +186,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -220,7 +203,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, sock=socks[i], @@ -233,15 +215,7 @@ custom-header: BLAH self.load('mirror', processes=i + 1) for i in range(conns): - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=socks[i], - body=body, - ) + resp = self.post(sock=socks[i], body=body) assert resp['body'] == body, 'keep-alive close' @@ -258,7 +232,6 @@ custom-header: BLAH headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -271,16 +244,7 @@ custom-header: BLAH assert self.get()['status'] == 200, 'init' - (resp, sock) = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - start=True, - sock=sock, - body=body, - ) + (resp, sock) = self.post(start=True, sock=sock, body=body) assert resp['status'] == 200, 'reconfigure 2 keep-alive 2' assert resp['body'] == '', 'reconfigure 2 keep-alive 2 body' diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index b3e02406..83af39be 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -347,7 +347,6 @@ class TestRubyApplication(TestApplicationRuby): headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body=body, @@ -357,15 +356,7 @@ class TestRubyApplication(TestApplicationRuby): assert resp['body'] == body, 'keep-alive 1' body = '0123456789' - resp = self.post( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body=body, - ) + resp = self.post(sock=sock, body=body) assert resp['body'] == body, 'keep-alive 2' diff --git a/test/test_tls.py b/test/test_tls.py index 3fa5dabf..d4edcbd3 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -505,7 +505,6 @@ basicConstraints = critical,CA:TRUE""" headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body='0123456789', @@ -518,7 +517,6 @@ basicConstraints = critical,CA:TRUE""" headers={ 'Host': 'localhost', 'Connection': 'close', - 'Content-Type': 'text/html', }, sock=sock, body='0123456789', @@ -570,9 +568,7 @@ basicConstraints = critical,CA:TRUE""" assert 'success' in self.conf_delete('/certificates/default') try: - resp = self.get_ssl( - headers={'Host': 'localhost', 'Connection': 'close'}, sock=sock - ) + resp = self.get_ssl(sock=sock) except KeyboardInterrupt: raise @@ -605,7 +601,6 @@ basicConstraints = critical,CA:TRUE""" headers={ 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', }, start=True, body='0123456789', @@ -622,15 +617,7 @@ basicConstraints = critical,CA:TRUE""" r' (?!' + app_id + r'#)(\d+)#\d+ "mirror" application started' ) - resp = self.post_ssl( - headers={ - 'Host': 'localhost', - 'Connection': 'close', - 'Content-Type': 'text/html', - }, - sock=sock, - body='0123456789', - ) + resp = self.post_ssl(sock=sock, body='0123456789') assert resp['status'] == 200, 'application respawn status' assert resp['body'] == '0123456789', 'application respawn body' |