diff options
| author | Andrei Zeliankou <zelenkov@nginx.com> | 2023-06-14 18:20:09 +0100 |
|---|---|---|
| committer | Andrei Zeliankou <zelenkov@nginx.com> | 2023-06-14 18:20:09 +0100 |
| commit | c183bd8749a19477390f8cb77efe5f6d223f0905 (patch) | |
| tree | 4e821e9cb07be9a86bf2d442acb3ea6740ba5a99 /test/test_routing_tls.py | |
| parent | c6d05191a069ac150cc8eb2bece75cf79c0a465a (diff) | |
| download | unit-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 'test/test_routing_tls.py')
| -rw-r--r-- | test/test_routing_tls.py | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/test/test_routing_tls.py b/test/test_routing_tls.py index 1ba79986..4a97c8e4 100644 --- a/test/test_routing_tls.py +++ b/test/test_routing_tls.py @@ -1,28 +1,29 @@ -from unit.applications.tls import TestApplicationTLS +from unit.applications.tls import ApplicationTLS prerequisites = {'modules': {'openssl': 'any'}} +client = ApplicationTLS() -class TestRoutingTLS(TestApplicationTLS): - def test_routes_match_scheme_tls(self): - self.certificate() - assert 'success' in self.conf( - { - "listeners": { - "*:7080": {"pass": "routes"}, - "*:7081": { - "pass": "routes", - "tls": {"certificate": 'default'}, - }, +def test_routes_match_scheme_tls(): + client.certificate() + + assert 'success' in client.conf( + { + "listeners": { + "*:7080": {"pass": "routes"}, + "*:7081": { + "pass": "routes", + "tls": {"certificate": 'default'}, }, - "routes": [ - {"match": {"scheme": "http"}, "action": {"return": 200}}, - {"match": {"scheme": "https"}, "action": {"return": 201}}, - ], - "applications": {}, - } - ), 'scheme configure' + }, + "routes": [ + {"match": {"scheme": "http"}, "action": {"return": 200}}, + {"match": {"scheme": "https"}, "action": {"return": 201}}, + ], + "applications": {}, + } + ), 'scheme configure' - assert self.get()['status'] == 200, 'http' - assert self.get_ssl(port=7081)['status'] == 201, 'https' + assert client.get()['status'] == 200, 'http' + assert client.get_ssl(port=7081)['status'] == 201, 'https' |
