test_php_application.py (1090:203a8e37e2dd) test_php_application.py (1092:f148d4caca98)
1import re
2import unittest
3from unit.applications.lang.php import TestApplicationPHP
4
5class TestPHPApplication(TestApplicationPHP):
6 prerequisites = ['php']
7
8 def before_disable_functions(self):

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

19 resp = self.post(
20 headers={
21 'Host': 'localhost',
22 'Content-Type': 'text/html',
23 'Custom-Header': 'blah',
24 'Connection': 'close',
25 },
26 body=body,
1import re
2import unittest
3from unit.applications.lang.php import TestApplicationPHP
4
5class TestPHPApplication(TestApplicationPHP):
6 prerequisites = ['php']
7
8 def before_disable_functions(self):

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

19 resp = self.post(
20 headers={
21 'Host': 'localhost',
22 'Content-Type': 'text/html',
23 'Custom-Header': 'blah',
24 'Connection': 'close',
25 },
26 body=body,
27 url='/index.php/blah?var=val'
27 )
28
29 self.assertEqual(resp['status'], 200, 'status')
30 headers = resp['headers']
31 header_server = headers.pop('Server')
32 self.assertRegex(header_server, r'Unit/[\d\.]+', 'server header')
33 self.assertEqual(
34 headers.pop('Server-Software'),

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

49
50 headers.pop('Content-type')
51 self.assertDictEqual(
52 headers,
53 {
54 'Connection': 'close',
55 'Content-Length': str(len(body)),
56 'Request-Method': 'POST',
28 )
29
30 self.assertEqual(resp['status'], 200, 'status')
31 headers = resp['headers']
32 header_server = headers.pop('Server')
33 self.assertRegex(header_server, r'Unit/[\d\.]+', 'server header')
34 self.assertEqual(
35 headers.pop('Server-Software'),

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

50
51 headers.pop('Content-type')
52 self.assertDictEqual(
53 headers,
54 {
55 'Connection': 'close',
56 'Content-Length': str(len(body)),
57 'Request-Method': 'POST',
57 'Request-Uri': '/',
58 'Path-Info': '/blah',
59 'Request-Uri': '/index.php/blah?var=val',
58 'Http-Host': 'localhost',
59 'Server-Protocol': 'HTTP/1.1',
60 'Custom-Header': 'blah',
61 },
62 'headers',
63 )
64 self.assertEqual(resp['body'], body, 'body')
65

--- 400 unchanged lines hidden ---
60 'Http-Host': 'localhost',
61 'Server-Protocol': 'HTTP/1.1',
62 'Custom-Header': 'blah',
63 },
64 'headers',
65 )
66 self.assertEqual(resp['body'], body, 'body')
67

--- 400 unchanged lines hidden ---