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_tls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_tls.py') diff --git a/test/test_tls.py b/test/test_tls.py index 4cf8d22c..32b97895 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -5,9 +5,9 @@ import subprocess import pytest -from conftest import option from conftest import skip_alert from unit.applications.tls import TestApplicationTLS +from unit.option import option class TestTLS(TestApplicationTLS): -- 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_tls.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/test_tls.py') diff --git a/test/test_tls.py b/test/test_tls.py index 32b97895..5a408ee2 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -5,7 +5,6 @@ import subprocess import pytest -from conftest import skip_alert from unit.applications.tls import TestApplicationTLS from unit.option import option @@ -505,7 +504,7 @@ basicConstraints = critical,CA:TRUE""" '/certificates' ), 'remove all certificates' - def test_tls_application_respawn(self): + def test_tls_application_respawn(self, skip_alert): self.load('mirror') self.certificate() -- 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_tls.py | 1 - 1 file changed, 1 deletion(-) (limited to 'test/test_tls.py') diff --git a/test/test_tls.py b/test/test_tls.py index 5a408ee2..f5df5ee1 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -4,7 +4,6 @@ import ssl import subprocess import pytest - from unit.applications.tls import TestApplicationTLS 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_tls.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test/test_tls.py') diff --git a/test/test_tls.py b/test/test_tls.py index f5df5ee1..89c57d07 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -19,7 +19,7 @@ class TestTLS(TestApplicationTLS): return self.date_to_sec_epoch(date, '%b %d %H:%M:%S %Y %Z') def add_tls(self, application='empty', cert='default', port=7080): - self.conf( + assert 'success' in self.conf( { "pass": "applications/" + application, "tls": {"certificate": cert} @@ -28,7 +28,7 @@ class TestTLS(TestApplicationTLS): ) def remove_tls(self, application='empty', port=7080): - self.conf( + assert 'success' in self.conf( {"pass": "applications/" + application}, 'listeners/*:' + str(port) ) @@ -477,8 +477,10 @@ basicConstraints = critical,CA:TRUE""" read_timeout=1, ) - self.conf({"pass": "applications/empty"}, 'listeners/*:7080') - self.conf_delete('/certificates/default') + assert 'success' in self.conf( + {"pass": "applications/empty"}, 'listeners/*:7080' + ) + assert 'success' in self.conf_delete('/certificates/default') try: resp = self.get_ssl( @@ -508,7 +510,7 @@ basicConstraints = critical,CA:TRUE""" self.certificate() - self.conf('1', 'applications/mirror/processes') + assert 'success' in self.conf('1', 'applications/mirror/processes') self.add_tls(application='mirror') -- cgit