test_perl_application.py (1029:687f7cc7aae2) test_perl_application.py (1064:75a64629661f)
1import unittest
2from unit.applications.lang.perl import TestApplicationPerl
3
4
5class TestPerlApplication(TestApplicationPerl):
6 prerequisites = ['perl']
7
8 def test_perl_application(self):

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

77
78 resp = self.get(url='/?')
79
80 self.assertEqual(resp['status'], 200, 'query string empty status')
81 self.assertEqual(
82 resp['headers']['Query-String'], '', 'query string empty'
83 )
84
1import unittest
2from unit.applications.lang.perl import TestApplicationPerl
3
4
5class TestPerlApplication(TestApplicationPerl):
6 prerequisites = ['perl']
7
8 def test_perl_application(self):

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

77
78 resp = self.get(url='/?')
79
80 self.assertEqual(resp['status'], 200, 'query string empty status')
81 self.assertEqual(
82 resp['headers']['Query-String'], '', 'query string empty'
83 )
84
85 @unittest.expectedFailure
86 def test_perl_application_query_string_absent(self):
87 self.load('query_string')
88
89 resp = self.get()
90
91 self.assertEqual(resp['status'], 200, 'query string absent status')
92 self.assertEqual(
93 resp['headers']['Query-String'], '', 'query string absent'
94 )
95
85 def test_perl_application_query_string_absent(self):
86 self.load('query_string')
87
88 resp = self.get()
89
90 self.assertEqual(resp['status'], 200, 'query string absent status')
91 self.assertEqual(
92 resp['headers']['Query-String'], '', 'query string absent'
93 )
94
96 @unittest.expectedFailure
95 @unittest.skip('not yet')
97 def test_perl_application_server_port(self):
98 self.load('server_port')
99
100 self.assertEqual(
101 self.get()['headers']['Server-Port'], '7080', 'Server-Port header'
102 )
103
104 def test_perl_application_input_read_empty(self):

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

110 self.load('input_read_parts')
111
112 self.assertEqual(
113 self.post(body='0123456789')['body'],
114 '0123456789',
115 'input read parts',
116 )
117
96 def test_perl_application_server_port(self):
97 self.load('server_port')
98
99 self.assertEqual(
100 self.get()['headers']['Server-Port'], '7080', 'Server-Port header'
101 )
102
103 def test_perl_application_input_read_empty(self):

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

109 self.load('input_read_parts')
110
111 self.assertEqual(
112 self.post(body='0123456789')['body'],
113 '0123456789',
114 'input read parts',
115 )
116
118 @unittest.expectedFailure
117 @unittest.skip('not yet')
119 def test_perl_application_input_read_offset(self):
120 self.load('input_read_offset')
121
122 self.assertEqual(
123 self.post(body='0123456789')['body'], '4567', 'read offset'
124 )
125
126 def test_perl_application_input_copy(self):

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

179
180 self.assertEqual(self.get()['status'], 200, 'body io empty')
181
182 def test_perl_application_body_io_file(self):
183 self.load('body_io_file')
184
185 self.assertEqual(self.get()['body'], 'body\n', 'body io file')
186
118 def test_perl_application_input_read_offset(self):
119 self.load('input_read_offset')
120
121 self.assertEqual(
122 self.post(body='0123456789')['body'], '4567', 'read offset'
123 )
124
125 def test_perl_application_input_copy(self):

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

178
179 self.assertEqual(self.get()['status'], 200, 'body io empty')
180
181 def test_perl_application_body_io_file(self):
182 self.load('body_io_file')
183
184 self.assertEqual(self.get()['body'], 'body\n', 'body io file')
185
187 @unittest.expectedFailure
186 @unittest.skip('not yet, unsafe')
188 def test_perl_application_syntax_error(self):
189 self.skip_alerts.extend(
187 def test_perl_application_syntax_error(self):
188 self.skip_alerts.extend(
190 [r'PSGI: Failed to parse script', r'process \d+ exited on signal']
189 [r'PSGI: Failed to parse script']
191 )
192 self.load('syntax_error')
193
194 self.assertEqual(self.get()['status'], 500, 'syntax error')
195
196 def test_perl_keepalive_body(self):
197 self.load('variables')
198

--- 61 unchanged lines hidden ---
190 )
191 self.load('syntax_error')
192
193 self.assertEqual(self.get()['status'], 500, 'syntax error')
194
195 def test_perl_keepalive_body(self):
196 self.load('variables')
197

--- 61 unchanged lines hidden ---