summaryrefslogtreecommitdiffhomepage
path: root/test/test_java_application.py
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org.ru>2022-12-14 01:43:24 +0000
committerSergey A. Osokin <osa@FreeBSD.org.ru>2022-12-14 01:43:24 +0000
commitc9c001ee16091c76773d3e9e655d777696dd755a (patch)
treefb4536933863895f454f0a8ec5fdcf310732328a /test/test_java_application.py
parent63cc4a31bdea2601c8adc08194759657f1476b16 (diff)
downloadunit-c9c001ee16091c76773d3e9e655d777696dd755a.tar.gz
unit-c9c001ee16091c76773d3e9e655d777696dd755a.tar.bz2
Java: upgrading third-party components.
Diffstat (limited to 'test/test_java_application.py')
-rw-r--r--test/test_java_application.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test_java_application.py b/test/test_java_application.py
index b4dbff59..b825d925 100644
--- a/test/test_java_application.py
+++ b/test/test_java_application.py
@@ -71,6 +71,11 @@ class TestJavaApplication(TestApplicationJava):
def test_java_application_get_variables(self):
self.load('get_params')
+ def check_header(header, expect):
+ values = header.split(' ')[:-1]
+ assert len(values) == len(expect)
+ assert set(values) == set(expect)
+
headers = self.get(url='/?var1=val1&var2=&var4=val4&var4=foo')[
'headers'
]
@@ -79,13 +84,11 @@ class TestJavaApplication(TestApplicationJava):
assert headers['X-Var-2'] == 'true', 'GET variables 2'
assert headers['X-Var-3'] == 'false', 'GET variables 3'
- assert (
- headers['X-Param-Names'] == 'var4 var2 var1 '
- ), 'getParameterNames'
- assert headers['X-Param-Values'] == 'val4 foo ', 'getParameterValues'
- assert (
- headers['X-Param-Map'] == 'var2= var1=val1 var4=val4,foo '
- ), 'getParameterMap'
+ check_header(headers['X-Param-Names'], ['var4', 'var2', 'var1'])
+ check_header(headers['X-Param-Values'], ['val4', 'foo'])
+ check_header(
+ headers['X-Param-Map'], ['var2=', 'var1=val1', 'var4=val4,foo']
+ )
def test_java_application_post_variables(self):
self.load('post_params')