From f55818059c01ff9e61bee8107ed1389fe272a787 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 29 May 2023 14:23:52 +0100 Subject: Tests: Log reworked. All log-related code moved to the log.py. --- test/unit/applications/proto.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/unit/applications/proto.py') diff --git a/test/unit/applications/proto.py b/test/unit/applications/proto.py index f4d4afe4..3f4c13d3 100644 --- a/test/unit/applications/proto.py +++ b/test/unit/applications/proto.py @@ -17,12 +17,10 @@ class TestApplicationProto(TestControl): return time.mktime(time.strptime(date, template)) def findall(self, pattern, name='unit.log', flags=re.M): - with Log.open(name) as f: - return re.findall(pattern, f.read(), flags) + return re.findall(pattern, Log.read(name), flags) def search_in_log(self, pattern, name='unit.log', flags=re.M): - with Log.open(name) as f: - return re.search(pattern, f.read(), flags) + return re.search(pattern, Log.read(name), flags) def wait_for_record(self, pattern, name='unit.log', wait=150, flags=re.M): with Log.open(name) as f: -- cgit