summaryrefslogtreecommitdiffhomepage
path: root/test/test_asgi_application_unix_abstract.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-06-14 18:20:09 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-06-14 18:20:09 +0100
commitc183bd8749a19477390f8cb77efe5f6d223f0905 (patch)
tree4e821e9cb07be9a86bf2d442acb3ea6740ba5a99 /test/test_asgi_application_unix_abstract.py
parentc6d05191a069ac150cc8eb2bece75cf79c0a465a (diff)
downloadunit-c183bd8749a19477390f8cb77efe5f6d223f0905.tar.gz
unit-c183bd8749a19477390f8cb77efe5f6d223f0905.tar.bz2
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.
Diffstat (limited to '')
-rw-r--r--test/test_asgi_application_unix_abstract.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/test_asgi_application_unix_abstract.py b/test/test_asgi_application_unix_abstract.py
index e473154a..980a98a9 100644
--- a/test/test_asgi_application_unix_abstract.py
+++ b/test/test_asgi_application_unix_abstract.py
@@ -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