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

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

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

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

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

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

162
163 def test_ruby_application_input_each(self):
164 self.load('input_each')
165
166 body = '\n01234\n56789\n\n'
167
168 self.assertEqual(self.post(body=body)['body'], body, 'input each')
169
97 def test_ruby_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_ruby_application_status_int(self):

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

161
162 def test_ruby_application_input_each(self):
163 self.load('input_each')
164
165 body = '\n01234\n56789\n\n'
166
167 self.assertEqual(self.post(body=body)['body'], body, 'input each')
168
170 @unittest.expectedFailure
169 @unittest.skip('not yet')
171 def test_ruby_application_input_rewind(self):
172 self.load('input_rewind')
173
174 body = '0123456789'
175
176 self.assertEqual(self.post(body=body)['body'], body, 'input rewind')
177
170 def test_ruby_application_input_rewind(self):
171 self.load('input_rewind')
172
173 body = '0123456789'
174
175 self.assertEqual(self.post(body=body)['body'], body, 'input rewind')
176
178 @unittest.expectedFailure
177 @unittest.skip('not yet')
179 def test_ruby_application_syntax_error(self):
180 self.skip_alerts.extend(
181 [
182 r'Failed to parse rack script',
183 r'syntax error',
184 r'new_from_string',
185 r'parse_file',
186 ]

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

259 resp = self.post(body="\ntc=one,two\ntc=three,four,\n\n")
260
261 self.assertEqual(
262 resp['headers']['Custom-Header'],
263 ['', 'tc=one,two', 'tc=three,four,', '', ''],
264 'header custom',
265 )
266
178 def test_ruby_application_syntax_error(self):
179 self.skip_alerts.extend(
180 [
181 r'Failed to parse rack script',
182 r'syntax error',
183 r'new_from_string',
184 r'parse_file',
185 ]

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

258 resp = self.post(body="\ntc=one,two\ntc=three,four,\n\n")
259
260 self.assertEqual(
261 resp['headers']['Custom-Header'],
262 ['', 'tc=one,two', 'tc=three,four,', '', ''],
263 'header custom',
264 )
265
267 @unittest.expectedFailure
266 @unittest.skip('not yet')
268 def test_ruby_application_header_custom_non_printable(self):
269 self.load('header_custom')
270
271 self.assertEqual(
272 self.post(body='\b')['status'], 500, 'header custom non printable'
273 )
274
275 def test_ruby_application_header_status(self):
276 self.load('header_status')
277
278 self.assertEqual(self.get()['status'], 200, 'header status')
279
267 def test_ruby_application_header_custom_non_printable(self):
268 self.load('header_custom')
269
270 self.assertEqual(
271 self.post(body='\b')['status'], 500, 'header custom non printable'
272 )
273
274 def test_ruby_application_header_status(self):
275 self.load('header_status')
276
277 self.assertEqual(self.get()['status'], 200, 'header status')
278
280 @unittest.expectedFailure
279 @unittest.skip('not yet')
281 def test_ruby_application_header_rack(self):
282 self.load('header_rack')
283
284 self.assertEqual(self.get()['status'], 500, 'header rack')
285
286 def test_ruby_application_body_empty(self):
287 self.load('body_empty')
288

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

295
296 def test_ruby_application_body_large(self):
297 self.load('mirror')
298
299 body = '0123456789' * 1000
300
301 self.assertEqual(self.post(body=body)['body'], body, 'body large')
302
280 def test_ruby_application_header_rack(self):
281 self.load('header_rack')
282
283 self.assertEqual(self.get()['status'], 500, 'header rack')
284
285 def test_ruby_application_body_empty(self):
286 self.load('body_empty')
287

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

294
295 def test_ruby_application_body_large(self):
296 self.load('mirror')
297
298 body = '0123456789' * 1000
299
300 self.assertEqual(self.post(body=body)['body'], body, 'body large')
301
303 @unittest.expectedFailure
302 @unittest.skip('not yet')
304 def test_ruby_application_body_each_error(self):
305 self.load('body_each_error')
306
307 self.assertEqual(self.get()['status'], 500, 'body each error status')
308
309 self.stop()
310
311 self.assertIsNotNone(

--- 42 unchanged lines hidden ---
303 def test_ruby_application_body_each_error(self):
304 self.load('body_each_error')
305
306 self.assertEqual(self.get()['status'], 500, 'body each error status')
307
308 self.stop()
309
310 self.assertIsNotNone(

--- 42 unchanged lines hidden ---