Tests: added test for callable write() in Python.
This commit is contained in:
5
test/python/write/wsgi.py
Normal file
5
test/python/write/wsgi.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
def application(env, start_response):
|
||||||
|
write = start_response('200', [('Content-Length', '10')])
|
||||||
|
write(b'012')
|
||||||
|
write(b'345')
|
||||||
|
return b'6789'
|
||||||
@@ -238,5 +238,10 @@ class TestUnitPythonApplication(unit.TestUnitApplicationPython):
|
|||||||
r'\[error\].+the application returned not an iterable object'),
|
r'\[error\].+the application returned not an iterable object'),
|
||||||
'not iterable')
|
'not iterable')
|
||||||
|
|
||||||
|
def test_python_application_write(self):
|
||||||
|
self.load('write')
|
||||||
|
|
||||||
|
self.assertEqual(self.get()['body'], '0123456789', 'write')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user