summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-04-02 17:03:41 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-04-02 17:03:41 +0300
commitefb71121b98c4dfded212e8b6fe33873cfd83376 (patch)
tree409023ef2fa8b7fe34b70a92bf04af7de9cc625f /test/test_python_application.py
parent001af5112275fcee1061fa8c1bc776a61b366712 (diff)
downloadunit-efb71121b98c4dfded212e8b6fe33873cfd83376.tar.gz
unit-efb71121b98c4dfded212e8b6fe33873cfd83376.tar.bz2
Tests: added Python test with iterator context.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r--test/test_python_application.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index 1a1a8741..0307a8f6 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -60,5 +60,28 @@ class TestUnitPythonApplication(unit.TestUnitApplicationPython):
self.assertNotIn('Transfer-Encoding', self.get()['headers'],
'204 header transfer encoding')
+ def test_python_application_ctx_iter_atexit(self):
+ self.skip_alerts.append(r'sendmsg.+failed')
+ self.load('ctx_iter_atexit')
+
+ resp = self.post(headers={
+ 'Connection': 'close',
+ 'Content-Type': 'text/html',
+ 'Host': 'localhost'
+ }, body='0123456789')
+
+ self.assertEqual(resp['status'], 200, 'ctx iter status')
+ self.assertEqual(resp['body'], '0123456789', 'ctx iter body')
+
+ self.conf({
+ "listeners": {},
+ "applications": {}
+ })
+
+ self.stop()
+
+ self.assertIsNotNone(self.search_in_log(r'RuntimeError'),
+ 'ctx iter atexit')
+
if __name__ == '__main__':
unittest.main()