summaryrefslogtreecommitdiffhomepage
path: root/test/test_perl_application.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-01-28 17:16:50 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-01-28 17:16:50 +0300
commit7dddfe2143e28dcde147d8420f0bd129babaec3a (patch)
tree5aa0463318a82e026cb01f57b1169a02ff04f433 /test/test_perl_application.py
parenteced6bc97284478d67bfec04e204e4cd212167d9 (diff)
downloadunit-7dddfe2143e28dcde147d8420f0bd129babaec3a.tar.gz
unit-7dddfe2143e28dcde147d8420f0bd129babaec3a.tar.bz2
Tests: added test for reading body from IO::Handle-like object.
Diffstat (limited to 'test/test_perl_application.py')
-rw-r--r--test/test_perl_application.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_perl_application.py b/test/test_perl_application.py
index 2dfae66c..7850e231 100644
--- a/test/test_perl_application.py
+++ b/test/test_perl_application.py
@@ -185,5 +185,19 @@ class TestUnitPerlApplication(unit.TestUnitApplicationPerl):
self.assertEqual(resp['body'], '0123456789', 'keep-alive 2')
+ @unittest.expectedFailure
+ def test_perl_body_io_fake(self):
+ self.load('body_io_fake')
+
+ self.assertEqual(self.get()['body'], '21', 'body io fake')
+
+ self.assertIsNotNone(
+ self.search_in_log(r'\[error\].+IOFake getline\(\) \$\/ is \d+'),
+ 'body io fake $/ value')
+
+ self.assertIsNotNone(
+ self.search_in_log(r'\[error\].+IOFake close\(\) called'),
+ 'body io fake close')
+
if __name__ == '__main__':
TestUnitPerlApplication.main()