summaryrefslogtreecommitdiffhomepage
path: root/test/test_access_log.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2021-01-12 06:20:23 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2021-01-12 06:20:23 +0000
commitf5ac1432463e58873b2c801b6db64dbe4d0e8f1c (patch)
tree7bf4b98c915e2bb90372189d061dd8067e4bf7c5 /test/test_access_log.py
parenta0bc946db306b921fd2db909377e72bf6671e843 (diff)
downloadunit-f5ac1432463e58873b2c801b6db64dbe4d0e8f1c.tar.gz
unit-f5ac1432463e58873b2c801b6db64dbe4d0e8f1c.tar.bz2
Tests: unit_stop() removed where possible.
Since wait_for_record() was introduced there is no need to stop Unit before parsing unit.log.
Diffstat (limited to 'test/test_access_log.py')
-rw-r--r--test/test_access_log.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/test/test_access_log.py b/test/test_access_log.py
index 0a0a6633..e82e42e3 100644
--- a/test/test_access_log.py
+++ b/test/test_access_log.py
@@ -2,7 +2,6 @@ import time
import pytest
-from conftest import unit_stop
from unit.applications.lang.python import TestApplicationPython
from unit.option import option
@@ -50,8 +49,6 @@ class TestAccessLog(TestApplicationPython):
body='0123456789',
)
- unit_stop()
-
assert (
self.wait_for_record(r'"POST / HTTP/1.1" 200 10') is not None
), 'keepalive 2'
@@ -78,8 +75,6 @@ Connection: close
raw=True,
)
- unit_stop()
-
assert (
self.wait_for_record(r'"GET / HTTP/1.1" 200 0 "Referer-1" "-"')
is not None
@@ -100,8 +95,6 @@ Connection: close
self.get(sock_type='ipv6')
- unit_stop()
-
assert (
self.wait_for_record(
r'::1 - - \[.+\] "GET / HTTP/1.1" 200 0 "-" "-"'
@@ -120,8 +113,6 @@ Connection: close
self.get(sock_type='unix', addr=addr)
- unit_stop()
-
assert (
self.wait_for_record(
r'unix: - - \[.+\] "GET / HTTP/1.1" 200 0 "-" "-"'
@@ -140,8 +131,6 @@ Connection: close
}
)
- unit_stop()
-
assert (
self.wait_for_record(r'"GET / HTTP/1.1" 200 0 "referer-value" "-"')
is not None
@@ -158,8 +147,6 @@ Connection: close
}
)
- unit_stop()
-
assert (
self.wait_for_record(
r'"GET / HTTP/1.1" 200 0 "-" "user-agent-value"'
@@ -172,8 +159,6 @@ Connection: close
self.get(http_10=True)
- unit_stop()
-
assert (
self.wait_for_record(r'"GET / HTTP/1.0" 200 0 "-" "-"') is not None
), 'http 1.0'
@@ -187,8 +172,6 @@ Connection: close
time.sleep(1)
- unit_stop()
-
assert (
self.wait_for_record(r'"GE" 400 0 "-" "-"') is not None
), 'partial'
@@ -200,8 +183,6 @@ Connection: close
self.http(b"""GET /\n""", raw=True)
- unit_stop()
-
assert (
self.wait_for_record(r'"GET /" 400 \d+ "-" "-"') is not None
), 'partial 2'
@@ -215,8 +196,6 @@ Connection: close
time.sleep(1)
- unit_stop()
-
assert (
self.wait_for_record(r'"GET /" 400 0 "-" "-"') is not None
), 'partial 3'
@@ -230,8 +209,6 @@ Connection: close
time.sleep(1)
- unit_stop()
-
assert (
self.wait_for_record(r'"GET / HTTP/1.1" 400 0 "-" "-"') is not None
), 'partial 4'
@@ -244,8 +221,6 @@ Connection: close
self.get(headers={'Connection': 'close'})
- unit_stop()
-
assert (
self.wait_for_record(r'"GET / HTTP/1.1" 400 \d+ "-" "-"')
is not None
@@ -256,8 +231,6 @@ Connection: close
self.get(url='/?blah&var=val')
- unit_stop()
-
assert (
self.wait_for_record(
r'"GET /\?blah&var=val HTTP/1.1" 200 0 "-" "-"'
@@ -272,8 +245,6 @@ Connection: close
self.get(url='/delete')
- unit_stop()
-
assert self.search_in_log(r'/delete', 'access.log') is None, 'delete'
def test_access_log_change(self, temp_dir):
@@ -285,8 +256,6 @@ Connection: close
self.get()
- unit_stop()
-
assert (
self.wait_for_record(r'"GET / HTTP/1.1" 200 0 "-" "-"', 'new.log')
is not None