diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2022-08-25 15:50:49 +0100 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2022-08-25 15:50:49 +0100 |
commit | d1cb8ab2bb27a864ec6cb21c5e64af315266100d (patch) | |
tree | 455d15d3fabde9f027081ec487d834a04add3d73 /test/test_asgi_application_unix_abstract.py | |
parent | 7e4a8a54221adf00cd3eb45a24b633ce61400570 (diff) | |
download | unit-d1cb8ab2bb27a864ec6cb21c5e64af315266100d.tar.gz unit-d1cb8ab2bb27a864ec6cb21c5e64af315266100d.tar.bz2 |
Tests: added tests with abstract UNIX sockets.
Diffstat (limited to 'test/test_asgi_application_unix_abstract.py')
-rw-r--r-- | test/test_asgi_application_unix_abstract.py | 23 |
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 |