summaryrefslogtreecommitdiffhomepage
path: root/test/test_php_application.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-11-11 14:24:40 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2020-11-11 14:24:40 +0000
commita0ee50826a4810595123460ed11629f87b1995a0 (patch)
tree293587f202e34031215de4b777a86c9d4d618b12 /test/test_php_application.py
parente30db59168eb83ba65b55df22b021085ae700605 (diff)
downloadunit-a0ee50826a4810595123460ed11629f87b1995a0.tar.gz
unit-a0ee50826a4810595123460ed11629f87b1995a0.tar.bz2
Tests: added a test for fastcgi_finish_request() function.
Diffstat (limited to '')
-rw-r--r--test/test_php_application.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_php_application.py b/test/test_php_application.py
index f1a9e293..578de0b7 100644
--- a/test/test_php_application.py
+++ b/test/test_php_application.py
@@ -94,6 +94,32 @@ class TestPHPApplication(TestApplicationPHP):
assert resp['status'] == 200, 'query string empty status'
assert resp['headers']['Query-String'] == '', 'query string empty'
+ def test_php_application_fastcgi_finish_request(self, temp_dir):
+ self.load('fastcgi_finish_request')
+
+ assert self.get()['body'] == '0123'
+
+ unit_stop()
+
+ with open(temp_dir + '/unit.log', 'r', errors='ignore') as f:
+ errs = re.findall(r'Error in fastcgi_finish_request', f.read())
+
+ assert len(errs) == 0, 'no error'
+
+ def test_php_application_fastcgi_finish_request_2(self, temp_dir):
+ self.load('fastcgi_finish_request')
+
+ resp = self.get(url='/?skip')
+ assert resp['status'] == 200
+ assert resp['body'] == ''
+
+ unit_stop()
+
+ with open(temp_dir + '/unit.log', 'r', errors='ignore') as f:
+ errs = re.findall(r'Error in fastcgi_finish_request', f.read())
+
+ assert len(errs) == 0, 'no error'
+
def test_php_application_query_string_absent(self):
self.load('query_string')