diff options
| author | oxpa <iippolitov@gmail.com> | 2024-09-17 14:21:10 +0100 |
|---|---|---|
| committer | oxpa <iippolitov@gmail.com> | 2024-09-17 14:21:10 +0100 |
| commit | 2417826d8bebf921ee1be102ef8ce702f0683d66 (patch) | |
| tree | 76d29a1705415ed7368870826dbb2f04942ee794 /test/test_python_application.py | |
| parent | 0e79d961bb1ea68674961da1703ffedb1ddf6e43 (diff) | |
| parent | 24ed91f40634372d99f67f0e4e3c2ac0abde81bd (diff) | |
| download | unit-2417826d8bebf921ee1be102ef8ce702f0683d66.tar.gz unit-2417826d8bebf921ee1be102ef8ce702f0683d66.tar.bz2 | |
Merge tag '1.33.0' into packaging.
Unit 1.33.0 release.
Diffstat (limited to 'test/test_python_application.py')
| -rw-r--r-- | test/test_python_application.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py index 466a59a2..c4803153 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -10,6 +10,7 @@ import pytest from packaging import version from unit.applications.lang.python import ApplicationPython +from unit.option import option prerequisites = {'modules': {'python': 'all'}} @@ -64,6 +65,45 @@ custom-header: BLAH }, 'headers' assert resp['body'] == body, 'body' + # REQUEST_URI unchanged + + path = f'{option.test_dir}/python/variables' + assert 'success' in client.conf( + { + "listeners": {"*:8080": {"pass": "routes"}}, + "routes": [ + { + "action": { + "rewrite": "/foo", + "pass": "applications/variables", + } + } + ], + "applications": { + "variables": { + "type": client.get_application_type(), + "processes": {'spare': 0}, + "path": path, + "working_directory": path, + "module": "wsgi", + } + }, + } + ) + + resp = client.http( + f"""POST /bar HTTP/1.1 +Host: localhost +Content-Length: 1 +Custom-Header: blah +Content-Type: text/html +Connection: close + +a""".encode(), + raw=True, + ) + assert resp['headers']['Request-Uri'] == '/bar', 'REQUEST_URI unchanged' + def test_python_application_query_string(): client.load('query_string') |
