summaryrefslogtreecommitdiffhomepage
path: root/test/unit/check/node.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-06-12 14:16:59 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-06-12 14:16:59 +0100
commitce2405ec3dd97e8bdf8f63312e3c6ce59ef562d4 (patch)
tree818e60eb10d7f2be90f25003b3a2b347314e966f /test/unit/check/node.py
parenta3b9b49cfb091410ca8f3c8d9df24d1fe184f8e0 (diff)
downloadunit-ce2405ec3dd97e8bdf8f63312e3c6ce59ef562d4.tar.gz
unit-ce2405ec3dd97e8bdf8f63312e3c6ce59ef562d4.tar.bz2
Tests: prerequisites checking reworked.
Prerequisites check moved to the module level to simplify class structure. Discovery and prerequisites checks functions moved to the separate files. Introduced "require" fixture to provide per-test requirements check.
Diffstat (limited to 'test/unit/check/node.py')
-rw-r--r--test/unit/check/node.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/unit/check/node.py b/test/unit/check/node.py
index dd59e7a4..6a3d581f 100644
--- a/test/unit/check/node.py
+++ b/test/unit/check/node.py
@@ -1,10 +1,12 @@
import os
import subprocess
+from unit.option import option
-def check_node(current_dir):
- if not os.path.exists(f'{current_dir}/node/node_modules'):
- return None
+
+def check_node():
+ if not os.path.exists(f'{option.current_dir}/node/node_modules'):
+ return False
try:
v_bytes = subprocess.check_output(['/usr/bin/env', 'node', '-v'])
@@ -12,4 +14,4 @@ def check_node(current_dir):
return [str(v_bytes, 'utf-8').lstrip('v').rstrip()]
except subprocess.CalledProcessError:
- return None
+ return False