Prerequisites check moved to the module level to simplify class structure. Discovery and prerequisites checks functions moved to the separate files. Introduced "require" fixture to provide per-test requirements check.
23 lines
640 B
Python
23 lines
640 B
Python
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
|