From f9a3328a2510e7237b8bd8f35a57914f6a22bbd2 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Mon, 24 Dec 2018 20:35:18 +0300 Subject: Tests: more QUERY_STRING tests. --- test/test_ruby_application.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index 57ab88cd..b88e043d 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -56,6 +56,25 @@ class TestUnitRubyApplication(unit.TestUnitApplicationRuby): self.assertEqual(resp['headers']['Query-String'], 'var1=val1&var2=val2', 'Query-String header') + def test_ruby_application_query_string_empty(self): + self.load('query_string') + + resp = self.get(url='/?') + + self.assertEqual(resp['status'], 200, 'query string empty status') + self.assertEqual(resp['headers']['Query-String'], '', + 'query string empty') + + @unittest.expectedFailure + def test_ruby_application_query_string_absent(self): + self.load('query_string') + + resp = self.get() + + self.assertEqual(resp['status'], 200, 'query string absent status') + self.assertEqual(resp['headers']['Query-String'], '', + 'query string absent') + @unittest.expectedFailure def test_ruby_application_server_port(self): self.load('server_port') -- cgit From 955050aea3148595fde027319fd427369856ebc9 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Wed, 20 Feb 2019 20:28:29 +0300 Subject: Tests: skip sendmsg()/recvmsg() alerts for all tests. Currently, these alerts may appear in the log when any application exits. --- test/test_ruby_application.py | 1 - 1 file changed, 1 deletion(-) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index b88e043d..9eed3e4a 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -208,7 +208,6 @@ class TestUnitRubyApplication(unit.TestUnitApplicationRuby): 'errors write int') def test_ruby_application_at_exit(self): - self.skip_alerts.append(r'sendmsg.+failed') self.load('at_exit') self.get() -- cgit From 4de2c8b56719fce6b95b6f8a613b349590a3676f Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Wed, 27 Feb 2019 19:15:02 +0300 Subject: Tests: added "Host" and "Connetion" headers where necessary. Also minor header organizing. --- test/test_ruby_application.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index 9eed3e4a..262fc497 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -14,7 +14,8 @@ class TestUnitRubyApplication(unit.TestUnitApplicationRuby): resp = self.post(headers={ 'Host': 'localhost', 'Content-Type': 'text/html', - 'Custom-Header': 'blah' + 'Custom-Header': 'blah', + 'Connection': 'close' }, body=body) self.assertEqual(resp['status'], 200, 'status') @@ -30,6 +31,7 @@ class TestUnitRubyApplication(unit.TestUnitApplicationRuby): 'date header') self.assertDictEqual(headers, { + 'Connection': 'close', 'Content-Length': str(len(body)), 'Content-Type': 'text/html', 'Request-Method': 'POST', @@ -286,17 +288,17 @@ class TestUnitRubyApplication(unit.TestUnitApplicationRuby): self.load('mirror') (resp, sock) = self.post(headers={ + 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', - 'Host': 'localhost' + 'Content-Type': 'text/html' }, start=True, body='0123456789' * 500) self.assertEqual(resp['body'], '0123456789' * 500, 'keep-alive 1') resp = self.post(headers={ + 'Host': 'localhost', 'Connection': 'close', - 'Content-Type': 'text/html', - 'Host': 'localhost' + 'Content-Type': 'text/html' }, sock=sock, body='0123456789') self.assertEqual(resp['body'], '0123456789', 'keep-alive 2') -- cgit