test_python_application.py (1250:2f335856beaa) test_python_application.py (1261:0150f7bd061d)
1import time
2import unittest
3from unit.applications.lang.python import TestApplicationPython
4
5
6class TestPythonApplication(TestApplicationPython):
7 prerequisites = {'modules': ['python']}
8

--- 493 unchanged lines hidden (view full) ---

502 'not iterable',
503 )
504
505 def test_python_application_write(self):
506 self.load('write')
507
508 self.assertEqual(self.get()['body'], '0123456789', 'write')
509
1import time
2import unittest
3from unit.applications.lang.python import TestApplicationPython
4
5
6class TestPythonApplication(TestApplicationPython):
7 prerequisites = {'modules': ['python']}
8

--- 493 unchanged lines hidden (view full) ---

502 'not iterable',
503 )
504
505 def test_python_application_write(self):
506 self.load('write')
507
508 self.assertEqual(self.get()['body'], '0123456789', 'write')
509
510 def test_python_application_threading(self):
511 """wait_for_record() timeouts after 5s while every thread works at
512 least 3s. So without releasing GIL test should fail.
513 """
510
514
515 self.load('threading')
516
517 for _ in range(10):
518 self.get(no_recv=True)
519
520 self.assertIsNotNone(
521 self.wait_for_record(r'\(5\) Thread: 100'), 'last thread finished'
522 )
523
511if __name__ == '__main__':
512 TestPythonApplication.main()
524if __name__ == '__main__':
525 TestPythonApplication.main()