summaryrefslogtreecommitdiffhomepage
path: root/test/test_asgi_application_unix_abstract.py
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-09-13 13:17:16 +0400
committerKonstantin Pavlov <thresh@nginx.com>2022-09-13 13:17:16 +0400
commitce964aa30b163e2b3263c5af57c1a6dae7d0cebb (patch)
tree26bf70c1a5991f6471fc4caed8628e068fdc0b7b /test/test_asgi_application_unix_abstract.py
parenteba4c3c98fa1bf275d94df8c727f70692ae7eae1 (diff)
parent38bd7e76a134084ab95a4ee3125af1ccd7b35864 (diff)
downloadunit-ce964aa30b163e2b3263c5af57c1a6dae7d0cebb.tar.gz
unit-ce964aa30b163e2b3263c5af57c1a6dae7d0cebb.tar.bz2
Merged with the default branch.1.28.0-1
Diffstat (limited to 'test/test_asgi_application_unix_abstract.py')
-rw-r--r--test/test_asgi_application_unix_abstract.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_asgi_application_unix_abstract.py b/test/test_asgi_application_unix_abstract.py
new file mode 100644
index 00000000..c4ec812f
--- /dev/null
+++ b/test/test_asgi_application_unix_abstract.py
@@ -0,0 +1,23 @@
+from packaging import version
+from unit.applications.lang.python import TestApplicationPython
+
+
+class TestASGIApplicationUnixAbstract(TestApplicationPython):
+ prerequisites = {
+ 'modules': {
+ 'python': lambda v: version.parse(v) >= version.parse('3.5')
+ },
+ 'features': ['unix_abstract'],
+ }
+ load_module = 'asgi'
+
+ def test_asgi_application_unix_abstract(self):
+ self.load('empty')
+
+ addr = '\0sock'
+ assert 'success' in self.conf(
+ {"unix:@" + addr[1:]: {"pass": "applications/empty"}},
+ 'listeners',
+ )
+
+ assert self.get(sock_type='unix', addr=addr)['status'] == 200