summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-05-29 14:23:52 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-05-29 14:23:52 +0100
commitf55818059c01ff9e61bee8107ed1389fe272a787 (patch)
tree27137343940f9212c5a22599c8d829f8759e84f1 /test/unit/applications
parentb034bf67034c4f0e966ebd207ba2f407f6f15fa8 (diff)
downloadunit-f55818059c01ff9e61bee8107ed1389fe272a787.tar.gz
unit-f55818059c01ff9e61bee8107ed1389fe272a787.tar.bz2
Tests: Log reworked.
All log-related code moved to the log.py.
Diffstat (limited to 'test/unit/applications')
-rw-r--r--test/unit/applications/proto.py6
1 files changed, 2 insertions, 4 deletions
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: