From e53ce40c5854d95722cdfc198626fcd5aecbe563 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 31 Jan 2022 23:10:30 +0000 Subject: Tests: removed TestApplicationTLS.get_server_certificate(). distutils.version is replaced by packaging.version. Also minor style fixes. --- test/test_variables.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/test_variables.py') diff --git a/test/test_variables.py b/test/test_variables.py index d8547b7b..f110fb74 100644 --- a/test/test_variables.py +++ b/test/test_variables.py @@ -103,20 +103,16 @@ class TestVariables(TestApplicationProto): def test_variables_empty(self): def update_pass(prefix): assert 'success' in self.conf( - { - "listeners": { - "*:7080": {"pass": prefix + "/$method"}, - }, - }, + {"listeners": {"*:7080": {"pass": prefix + "/$method"}}}, ), 'variables empty' - update_pass("routes"); + update_pass("routes") assert self.get(url='/1')['status'] == 404 - update_pass("upstreams"); + update_pass("upstreams") assert self.get(url='/2')['status'] == 404 - update_pass("applications"); + update_pass("applications") assert self.get(url='/3')['status'] == 404 def test_variables_invalid(self): -- cgit From aee8b9bfb25df4490d137655d0ce097a6b9706fc Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 30 May 2022 17:53:12 +0200 Subject: Tests: Added tests for $request_uri. --- test/test_variables.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/test_variables.py') diff --git a/test/test_variables.py b/test/test_variables.py index f110fb74..728e86b0 100644 --- a/test/test_variables.py +++ b/test/test_variables.py @@ -17,6 +17,7 @@ class TestVariables(TestApplicationProto): "5GET": [{"action": {"return": 206}}], "GETGET": [{"action": {"return": 207}}], "localhost": [{"action": {"return": 208}}], + "9*?q": [{"action": {"return": 209}}], }, }, ), 'configure routes' @@ -28,6 +29,14 @@ class TestVariables(TestApplicationProto): assert self.get()['status'] == 201, 'method GET' assert self.post()['status'] == 202, 'method POST' + def test_variables_request_uri(self): + self.conf_routes("\"routes$request_uri\"") + + assert self.get(url='/3')['status'] == 203, 'request_uri' + assert self.get(url='/4*')['status'] == 204, 'request_uri 2' + assert self.get(url='/4%2A')['status'] == 204, 'request_uri 3' + assert self.get(url='/9%2A?q')['status'] == 209, 'request_uri & query' + def test_variables_uri(self): self.conf_routes("\"routes$uri\"") -- cgit From 161230b955ba8a6a22888c21f1b067de61af78dd Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 1 Jun 2022 16:40:27 +0100 Subject: Tests: improved test for $request_uri variable. --- test/test_variables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_variables.py') diff --git a/test/test_variables.py b/test/test_variables.py index 728e86b0..71553685 100644 --- a/test/test_variables.py +++ b/test/test_variables.py @@ -17,7 +17,7 @@ class TestVariables(TestApplicationProto): "5GET": [{"action": {"return": 206}}], "GETGET": [{"action": {"return": 207}}], "localhost": [{"action": {"return": 208}}], - "9*?q": [{"action": {"return": 209}}], + "9?q#a": [{"action": {"return": 209}}], }, }, ), 'configure routes' @@ -35,7 +35,7 @@ class TestVariables(TestApplicationProto): assert self.get(url='/3')['status'] == 203, 'request_uri' assert self.get(url='/4*')['status'] == 204, 'request_uri 2' assert self.get(url='/4%2A')['status'] == 204, 'request_uri 3' - assert self.get(url='/9%2A?q')['status'] == 209, 'request_uri & query' + assert self.get(url='/9?q#a')['status'] == 209, 'request_uri query' def test_variables_uri(self): self.conf_routes("\"routes$uri\"") -- cgit