summaryrefslogtreecommitdiffhomepage
path: root/test/test_static_types.py
diff options
context:
space:
mode:
authorDan Callahan <d.callahan@f5.com>2024-02-27 15:15:42 +0000
committerDan Callahan <d.callahan@f5.com>2024-02-27 15:15:42 +0000
commitd76761901c4084bcdbc5a449e9bbb47d56b7093c (patch)
treeb4b7b4e3d588b73a2adcc0094cab466d9194c679 /test/test_static_types.py
parentc43629880472bba8d389dfb0b7ae6d883b0ba499 (diff)
parent088117008c9e8f397a58cc8d8070ce047beff12f (diff)
downloadunit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.gz
unit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.bz2
Merge tag '1.32.0' into branches/packaging1.32.0-1
Unit 1.32.0 release.
Diffstat (limited to 'test/test_static_types.py')
-rw-r--r--test/test_static_types.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/test_static_types.py b/test/test_static_types.py
index 8cd28ca4..e931d949 100644
--- a/test/test_static_types.py
+++ b/test/test_static_types.py
@@ -1,6 +1,7 @@
from pathlib import Path
import pytest
+
from unit.applications.proto import ApplicationProto
client = ApplicationProto()
@@ -10,15 +11,15 @@ client = ApplicationProto()
def setup_method_fixture(temp_dir):
Path(f'{temp_dir}/assets').mkdir()
for ext in ['.xml', '.mp4', '.php', '', '.txt', '.html', '.png']:
- Path(f'{temp_dir}/assets/file{ext}').write_text(ext)
+ Path(f'{temp_dir}/assets/file{ext}').write_text(ext, encoding='utf-8')
- Path(f'{temp_dir}/assets/index.html').write_text('index')
+ Path(f'{temp_dir}/assets/index.html').write_text('index', encoding='utf-8')
assert 'success' in client.conf(
{
"listeners": {
- "*:7080": {"pass": "routes"},
- "*:7081": {"pass": "routes"},
+ "*:8080": {"pass": "routes"},
+ "*:8081": {"pass": "routes"},
},
"routes": [{"action": {"share": f'{temp_dir}/assets$uri'}}],
"applications": {},
@@ -124,14 +125,14 @@ def test_static_types_fallback(temp_dir):
assert 'success' in client.conf(
[
{
- "match": {"destination": "*:7081"},
+ "match": {"destination": "*:8081"},
"action": {"return": 200},
},
{
"action": {
"share": f'{temp_dir}/assets$uri',
"types": ["!application/x-httpd-php"],
- "fallback": {"proxy": "http://127.0.0.1:7081"},
+ "fallback": {"proxy": "http://127.0.0.1:8081"},
}
},
],
@@ -155,7 +156,7 @@ def test_static_types_index(temp_dir):
def test_static_types_custom_mime(temp_dir):
assert 'success' in client.conf(
{
- "listeners": {"*:7080": {"pass": "routes"}},
+ "listeners": {"*:8080": {"pass": "routes"}},
"routes": [{"action": {"share": f'{temp_dir}/assets$uri'}}],
"applications": {},
"settings": {