Deleted
Added
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 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 |
96 @unittest.skip('not yet') |
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 |
169 @unittest.skip('not yet') |
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 |
177 @unittest.skip('not yet') |
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 |
266 @unittest.skip('not yet') |
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 |
279 @unittest.skip('not yet') |
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 |
302 @unittest.skip('not yet') |
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 --- |