summaryrefslogtreecommitdiffhomepage
path: root/test/test_perl_application.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_perl_application.py')
-rw-r--r--test/test_perl_application.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_perl_application.py b/test/test_perl_application.py
index c9cb3f0c..7850e231 100644
--- a/test/test_perl_application.py
+++ b/test/test_perl_application.py
@@ -55,6 +55,25 @@ class TestUnitPerlApplication(unit.TestUnitApplicationPerl):
self.assertEqual(resp['headers']['Query-String'], 'var1=val1&var2=val2',
'Query-String header')
+ def test_perl_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_perl_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_perl_application_server_port(self):
self.load('server_port')
@@ -166,5 +185,19 @@ class TestUnitPerlApplication(unit.TestUnitApplicationPerl):
self.assertEqual(resp['body'], '0123456789', 'keep-alive 2')
+ @unittest.expectedFailure
+ def test_perl_body_io_fake(self):
+ self.load('body_io_fake')
+
+ self.assertEqual(self.get()['body'], '21', 'body io fake')
+
+ self.assertIsNotNone(
+ self.search_in_log(r'\[error\].+IOFake getline\(\) \$\/ is \d+'),
+ 'body io fake $/ value')
+
+ self.assertIsNotNone(
+ self.search_in_log(r'\[error\].+IOFake close\(\) called'),
+ 'body io fake close')
+
if __name__ == '__main__':
TestUnitPerlApplication.main()