7934dcabbc
Previously, it was necessary to support older versions of Python for compatibility. F-strings were released in Python 3.6. Python 3.5 was marked as unsupported by the end of 2020, so now it's possible to start using f-strings safely for better readability and performance.
23 lines
671 B
Python
23 lines
671 B
Python
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(
|
|
{f"unix:@{addr[1:]}": {"pass": "applications/empty"}},
|
|
'listeners',
|
|
)
|
|
|
|
assert self.get(sock_type='unix', addr=addr)['status'] == 200
|