From 0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 8 Nov 2023 18:37:02 +0000 Subject: Tests: 8XXX used as default port range. After the launch of the project, the testing infrastructure was shared with nginx project in some cases. To avoid port overlap, a decision was made to shift the port range for Unit tests. This problem was resolved a long time ago and is no longer relevant, so it is now safe to use port 8XXX range as the default, as it is more appropriate for testing purposes. --- test/test_http_header.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/test_http_header.py') diff --git a/test/test_http_header.py b/test/test_http_header.py index af836e6f..cf5866e9 100644 --- a/test/test_http_header.py +++ b/test/test_http_header.py @@ -333,7 +333,7 @@ def test_http_header_host_port(): client.load('host') resp = client.get( - headers={'Host': 'exmaple.com:7080', 'Connection': 'close'} + headers={'Host': 'exmaple.com:8080', 'Connection': 'close'} ) assert resp['status'] == 200, 'Host port status' @@ -341,7 +341,7 @@ def test_http_header_host_port(): resp['headers']['X-Server-Name'] == 'exmaple.com' ), 'Host port SERVER_NAME' assert ( - resp['headers']['X-Http-Host'] == 'exmaple.com:7080' + resp['headers']['X-Http-Host'] == 'exmaple.com:8080' ), 'Host port HTTP_HOST' @@ -373,14 +373,14 @@ def test_http_header_host_literal(): def test_http_header_host_literal_ipv6(): client.load('host') - resp = client.get(headers={'Host': '[::1]:7080', 'Connection': 'close'}) + resp = client.get(headers={'Host': '[::1]:8080', 'Connection': 'close'}) assert resp['status'] == 200, 'Host literal ipv6 status' assert ( resp['headers']['X-Server-Name'] == '[::1]' ), 'Host literal ipv6 SERVER_NAME' assert ( - resp['headers']['X-Http-Host'] == '[::1]:7080' + resp['headers']['X-Http-Host'] == '[::1]:8080' ), 'Host literal ipv6 HTTP_HOST' -- cgit From 5a8337933df1cf3aba967d86549e236dd9173386 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 15 Jan 2024 15:48:58 +0000 Subject: Tests: pathlib used where appropriate Also fixed various pylint errors and style issues. --- test/test_http_header.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test/test_http_header.py') diff --git a/test/test_http_header.py b/test/test_http_header.py index cf5866e9..f6579df5 100644 --- a/test/test_http_header.py +++ b/test/test_http_header.py @@ -1,4 +1,5 @@ import pytest + from unit.applications.lang.python import ApplicationPython prerequisites = {'modules': {'python': 'any'}} -- cgit