Tests: minor fixes.
Fixed temporary dir removing. Fixed printing path to log. Module checks moved to the separate file.
This commit is contained in:
29
test/unit/check/go.py
Normal file
29
test/unit/check/go.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def check_go(current_dir, temp_dir, test_dir):
|
||||
if not os.path.exists(temp_dir + '/go'):
|
||||
os.mkdir(temp_dir + '/go')
|
||||
|
||||
env = os.environ.copy()
|
||||
env['GOPATH'] = current_dir + '/build/go'
|
||||
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
[
|
||||
'go',
|
||||
'build',
|
||||
'-o',
|
||||
temp_dir + '/go/app',
|
||||
test_dir + '/go/empty/app.go',
|
||||
],
|
||||
env=env,
|
||||
)
|
||||
process.communicate()
|
||||
|
||||
if process.returncode == 0:
|
||||
return True
|
||||
|
||||
except:
|
||||
return None
|
||||
6
test/unit/check/node.py
Normal file
6
test/unit/check/node.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import os
|
||||
|
||||
|
||||
def check_node(current_dir):
|
||||
if os.path.exists(current_dir + '/node/node_modules'):
|
||||
return True
|
||||
13
test/unit/check/tls.py
Normal file
13
test/unit/check/tls.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
|
||||
def check_openssl(unitd):
|
||||
subprocess.check_output(['which', 'openssl'])
|
||||
|
||||
output = subprocess.check_output(
|
||||
[unitd, '--version'], stderr=subprocess.STDOUT
|
||||
)
|
||||
|
||||
if re.search('--openssl', output.decode()):
|
||||
return True
|
||||
Reference in New Issue
Block a user