Tests: added delay to wait for requests logging.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from subprocess import call
|
||||
import unittest
|
||||
import unit
|
||||
@@ -27,6 +28,8 @@ class TestUnitAccessLog(unit.TestUnitApplicationPython):
|
||||
'Host': 'localhost'
|
||||
}, start=True, body='01234')
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.assertIsNotNone(
|
||||
self.search_in_log(r'"POST / HTTP/1.1" 200 5'), 'keepalive 1')
|
||||
|
||||
@@ -36,6 +39,8 @@ class TestUnitAccessLog(unit.TestUnitApplicationPython):
|
||||
'Host': 'localhost'
|
||||
}, sock=sock, body='0123456789')
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -59,6 +64,8 @@ Connection: close
|
||||
|
||||
""", raw_resp=True, raw=True)
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -82,6 +89,8 @@ Connection: close
|
||||
|
||||
self.get(sock_type='ipv6')
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -97,6 +106,8 @@ Connection: close
|
||||
'Connection': 'close'
|
||||
})
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -112,6 +123,8 @@ Connection: close
|
||||
'Connection': 'close'
|
||||
})
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -123,6 +136,8 @@ Connection: close
|
||||
|
||||
self.get(http_10=True)
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -134,6 +149,8 @@ Connection: close
|
||||
|
||||
self.http(b"""GE""", raw_resp=True, raw=True)
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -144,6 +161,8 @@ Connection: close
|
||||
|
||||
self.http(b"""GET /\n""", raw_resp=True, raw=True)
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -154,6 +173,8 @@ Connection: close
|
||||
|
||||
self.http(b"""GET / HTTP/1.1""", raw_resp=True, raw=True)
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -164,6 +185,8 @@ Connection: close
|
||||
|
||||
resp = self.http(b"""GET / HTTP/1.1\n""", raw_resp=True, raw=True)
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -185,6 +208,8 @@ Connection: close
|
||||
|
||||
self.get(url='/?blah&var=val')
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -199,6 +224,8 @@ Connection: close
|
||||
|
||||
self.get(url='/delete')
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNone(self.search_in_log(r'/delete'), 'delete')
|
||||
@@ -212,6 +239,8 @@ Connection: close
|
||||
|
||||
self.get()
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.stop()
|
||||
|
||||
self.assertIsNotNone(
|
||||
@@ -231,6 +260,8 @@ Connection: close
|
||||
|
||||
self.get()
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.assertIsNotNone(
|
||||
self.search_in_log(r'"GET / HTTP/1.1" 200 0 "-" "-"', 'new.log'),
|
||||
'rename new')
|
||||
@@ -245,6 +276,8 @@ Connection: close
|
||||
|
||||
self.get(url='/usr1')
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
self.assertIsNone(
|
||||
self.search_in_log(r'/usr1', 'new.log'), 'rename new 2')
|
||||
self.assertIsNotNone(
|
||||
|
||||
Reference in New Issue
Block a user