summaryrefslogtreecommitdiffhomepage
path: root/test/test_asgi_application_unix_abstract.py
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-08-31 09:41:46 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-08-31 09:41:46 -0700
commitc45c8919c7232eb20023484f6d1fc9f1f50395d8 (patch)
treecc12eb307c1611494948645e4b487fa06495c3d2 /test/test_asgi_application_unix_abstract.py
parent88c90e1c351ab8c5bd487a5cd4b735014b08e271 (diff)
parent9b22b6957bc87b3df002d0bc691fdae6a20abdac (diff)
downloadunit-1.31.0-1.tar.gz
unit-1.31.0-1.tar.bz2
Merged with the default branch.1.31.0-1
Diffstat (limited to '')
-rw-r--r--test/test_asgi_application_unix_abstract.py32
1 files changed, 15 insertions, 17 deletions
diff --git a/test/test_asgi_application_unix_abstract.py b/test/test_asgi_application_unix_abstract.py
index 2ca7839f..980a98a9 100644
--- a/test/test_asgi_application_unix_abstract.py
+++ b/test/test_asgi_application_unix_abstract.py
@@ -1,23 +1,21 @@
from packaging import version
-from unit.applications.lang.python import TestApplicationPython
+from unit.applications.lang.python import ApplicationPython
+prerequisites = {
+ 'modules': {'python': lambda v: version.parse(v) >= version.parse('3.5')},
+ 'features': {'unix_abstract': True},
+}
-class TestASGIApplicationUnixAbstract(TestApplicationPython):
- prerequisites = {
- 'modules': {
- 'python': lambda v: version.parse(v) >= version.parse('3.5')
- },
- 'features': ['unix_abstract'],
- }
- load_module = 'asgi'
+client = ApplicationPython(load_module='asgi')
- def test_asgi_application_unix_abstract(self):
- self.load('empty')
- addr = '\0sock'
- assert 'success' in self.conf(
- {f"unix:@{addr[1:]}": {"pass": "applications/empty"}},
- 'listeners',
- )
+def test_asgi_application_unix_abstract():
+ client.load('empty')
- assert self.get(sock_type='unix', addr=addr)['status'] == 200
+ addr = '\0sock'
+ assert 'success' in client.conf(
+ {f"unix:@{addr[1:]}": {"pass": "applications/empty"}},
+ 'listeners',
+ )
+
+ assert client.get(sock_type='unix', addr=addr)['status'] == 200