From 07789a23e9c513dba87b020fae2989a57955e8a6 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Sun, 6 Dec 2020 16:01:59 +0000 Subject: Tests: options moved to the separate class. This change is necessary to separate the logic and prevent possible circular dependency. --- test/test_proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index be3e93fd..90b6b657 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -4,11 +4,11 @@ import time import pytest -from conftest import option from conftest import run_process from conftest import skip_alert from conftest import waitforsocket from unit.applications.lang.python import TestApplicationPython +from unit.option import option class TestProxy(TestApplicationPython): -- cgit From 8f916285639d7f9aac9ef03cace5e4dcbcca70cd Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 8 Dec 2020 14:37:25 +0000 Subject: Tests: utils module introduced. --- test/test_proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index 90b6b657..975a76a0 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -6,9 +6,9 @@ import pytest from conftest import run_process from conftest import skip_alert -from conftest import waitforsocket from unit.applications.lang.python import TestApplicationPython from unit.option import option +from unit.utils import waitforsocket class TestProxy(TestApplicationPython): -- cgit From b2e767819f04153944d525ef8d97d2f3a7a9af74 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 8 Dec 2020 14:37:33 +0000 Subject: Tests: skip_alert() converted to the fixture. --- test/test_proxy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index 975a76a0..0eebab1e 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -5,7 +5,6 @@ import time import pytest from conftest import run_process -from conftest import skip_alert from unit.applications.lang.python import TestApplicationPython from unit.option import option from unit.utils import waitforsocket @@ -482,7 +481,7 @@ Content-Length: 10 check_proxy('http://[:]:7080') check_proxy('http://[::7080') - def test_proxy_loop(self): + def test_proxy_loop(self, skip_alert): skip_alert( r'socket.*failed', r'accept.*failed', -- cgit From 6dc9c47ccd26b23b61b7522803a667c2e515e260 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 13 Jan 2021 06:22:43 +0000 Subject: Tests: style. --- test/test_proxy.py | 1 - 1 file changed, 1 deletion(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index 0eebab1e..b7c34390 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -3,7 +3,6 @@ import socket import time import pytest - from conftest import run_process from unit.applications.lang.python import TestApplicationPython from unit.option import option -- cgit From d43a84139d1adedbae8def67c8bbee09d8cf4581 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Thu, 14 Jan 2021 03:04:20 +0000 Subject: Tests: added missing checks for configuration results. --- test/test_proxy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index b7c34390..2d305e98 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -172,7 +172,9 @@ Content-Length: 10 assert resp['status'] == 200, 'status' assert resp['body'] == payload, 'body' - self.conf({'http': {'max_body_size': 32 * 1024 * 1024}}, 'settings') + assert 'success' in self.conf( + {'http': {'max_body_size': 32 * 1024 * 1024}}, 'settings' + ) payload = '0123456789abcdef' * 32 * 64 * 1024 resp = self.post_http10(body=payload, read_buffer_size=1024 * 1024) @@ -486,7 +488,7 @@ Content-Length: 10 r'accept.*failed', r'new connections are not accepted', ) - self.conf( + assert 'success' in self.conf( { "listeners": { "*:7080": {"pass": "routes"}, -- cgit