diff options
| author | Konstantin Pavlov <thresh@nginx.com> | 2022-06-02 16:51:49 +0400 |
|---|---|---|
| committer | Konstantin Pavlov <thresh@nginx.com> | 2022-06-02 16:51:49 +0400 |
| commit | d9fddee1dbfc1f5d49c8f40386289d7188030952 (patch) | |
| tree | 842a62b343ac33eba10e7a426a10b55bb1c46aed /test/test_variables.py | |
| parent | 420395ee2e7cd464e157c49bea3d74f15bf25f30 (diff) | |
| parent | 0d48fe73c4450901622373e35f6ff3a944ec13d6 (diff) | |
| download | unit-1.27.0-1.tar.gz unit-1.27.0-1.tar.bz2 | |
Merged with the default branch.1.27.0-1
Diffstat (limited to 'test/test_variables.py')
| -rw-r--r-- | test/test_variables.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/test_variables.py b/test/test_variables.py index d8547b7b..71553685 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#a": [{"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?q#a')['status'] == 209, 'request_uri query' + def test_variables_uri(self): self.conf_routes("\"routes$uri\"") @@ -103,20 +112,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): |
