From 6c97a1a069f0ae8cf683c8364fb7f9dabc5e89cb Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 5 Apr 2021 14:03:05 +0100 Subject: Tests: style. --- test/test_python_application.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/test_python_application.py') diff --git a/test/test_python_application.py b/test/test_python_application.py index 41f6f538..fd99a3af 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -5,6 +5,7 @@ import re import time import pytest + from unit.applications.lang.python import TestApplicationPython from unit.option import option @@ -31,7 +32,8 @@ Content-Type: text/html Connection: close custom-header: BLAH -%s""" % (len(body), body.encode()), +%s""" + % (len(body), body.encode()), raw=True, ) @@ -816,7 +818,11 @@ last line: 987654321 assert ['/new', *sys_path] == get_path(), 'check path update' set_path('["/blah1", "/blah2"]') - assert ['/blah1', '/blah2', *sys_path] == get_path(), 'check path array' + assert [ + '/blah1', + '/blah2', + *sys_path, + ] == get_path(), 'check path array' def test_python_application_path_invalid(self): self.load('path') -- cgit From 74b1b1fc17726d805b00dee6b5547254f5cf230c Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Thu, 8 Apr 2021 19:11:11 +0300 Subject: Tests: preserving unit.log when run without restart. Introducing "unit.log.Log" class for "unit.log" file management. Moving "findall()" function into TestApplicationProto. Using "os.kill()" to send signals. --- test/test_python_application.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'test/test_python_application.py') diff --git a/test/test_python_application.py b/test/test_python_application.py index fd99a3af..48c3d603 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -7,16 +7,11 @@ import time import pytest from unit.applications.lang.python import TestApplicationPython -from unit.option import option class TestPythonApplication(TestApplicationPython): prerequisites = {'modules': {'python': 'all'}} - def findall(self, pattern): - with open(option.temp_dir + '/unit.log', 'r', errors='ignore') as f: - return re.findall(pattern, f.read()) - def test_python_application_variables(self): self.load('variables') -- cgit