Tests: get rid of classes in test files.
Class usage came from the unittest framework and it was always redundant after migration to the pytest. This commit removes classes from files containing tests to make them more readable and understandable.
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
from packaging import version
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.applications.lang.python import ApplicationPython
|
||||
|
||||
prerequisites = {
|
||||
'modules': {'python': lambda v: version.parse(v) >= version.parse('3.5')},
|
||||
'features': {'unix_abstract': True},
|
||||
}
|
||||
|
||||
client = ApplicationPython(load_module='asgi')
|
||||
|
||||
class TestASGIApplicationUnixAbstract(TestApplicationPython):
|
||||
load_module = 'asgi'
|
||||
|
||||
def test_asgi_application_unix_abstract(self):
|
||||
self.load('empty')
|
||||
def test_asgi_application_unix_abstract():
|
||||
client.load('empty')
|
||||
|
||||
addr = '\0sock'
|
||||
assert 'success' in self.conf(
|
||||
{f"unix:@{addr[1:]}": {"pass": "applications/empty"}},
|
||||
'listeners',
|
||||
)
|
||||
addr = '\0sock'
|
||||
assert 'success' in client.conf(
|
||||
{f"unix:@{addr[1:]}": {"pass": "applications/empty"}},
|
||||
'listeners',
|
||||
)
|
||||
|
||||
assert self.get(sock_type='unix', addr=addr)['status'] == 200
|
||||
assert client.get(sock_type='unix', addr=addr)['status'] == 200
|
||||
|
||||
Reference in New Issue
Block a user