summaryrefslogtreecommitdiffhomepage
path: root/test/test_asgi_application_unix_abstract.py
blob: e473154a70a56051d793a35e29cc1a56902a010c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from packaging import version
from unit.applications.lang.python import TestApplicationPython

prerequisites = {
    'modules': {'python': lambda v: version.parse(v) >= version.parse('3.5')},
    'features': {'unix_abstract': True},
}


class TestASGIApplicationUnixAbstract(TestApplicationPython):
    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',
        )

        assert self.get(sock_type='unix', addr=addr)['status'] == 200