summaryrefslogtreecommitdiffhomepage
path: root/test/unit.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-02-14 17:14:16 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-02-14 17:14:16 +0300
commitee39da0e00423d2e4f109f90142c3543e819c14d (patch)
treeb08346f2f11f25ed6bc5438eb81795c2666df549 /test/unit.py
parent27b00629e1e3af2f8b84aa349351df50f05f3c83 (diff)
downloadunit-ee39da0e00423d2e4f109f90142c3543e819c14d.tar.gz
unit-ee39da0e00423d2e4f109f90142c3543e819c14d.tar.bz2
Tests: removed unused code in unit.py.
Diffstat (limited to 'test/unit.py')
-rw-r--r--test/unit.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/test/unit.py b/test/unit.py
index 81221a39..43f4d632 100644
--- a/test/unit.py
+++ b/test/unit.py
@@ -21,10 +21,6 @@ class TestUnit(unittest.TestCase):
def tearDown(self):
self._stop()
- if '--log' in sys.argv:
- with open(self.testdir + '/unit.log', 'r') as f:
- print(f.read())
-
if '--leave' not in sys.argv:
shutil.rmtree(self.testdir)
@@ -34,7 +30,7 @@ class TestUnit(unittest.TestCase):
for i in range(50):
with open(self.testdir + '/unit.log', 'r') as f:
log = f.read()
- m = re.search('controller started', log, re.M | re.S)
+ m = re.search('controller started', log)
if m is None:
time.sleep(0.1)
@@ -42,11 +38,12 @@ class TestUnit(unittest.TestCase):
break
if m is None:
+ self._stop()
exit("Unit is writing log too long")
missed_module = ''
for module in modules:
- m = re.search('module: ' + module, log, re.M | re.S)
+ m = re.search('module: ' + module, log)
if m is None:
missed_module = module
break
@@ -57,17 +54,6 @@ class TestUnit(unittest.TestCase):
if missed_module:
raise unittest.SkipTest('Unit has no ' + missed_module + ' module')
- def check_version(self, version):
- with open(self.pardir + '/src/nxt_main.h' , 'r') as f:
- m = re.search('NXT_VERSION\s+"(\d+\.\d+)"', f.read(), re.M | re.S)
-
- current = m.group(1).split('.')
- need = version.split('.')
-
- for i in range(len(need)):
- if need[i] > current[i]:
- raise unittest.SkipTest('Unit too old')
-
def _run(self):
self.testdir = tempfile.mkdtemp(prefix='unit-test-')