summaryrefslogtreecommitdiffhomepage
path: root/test/unit.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit.py')
-rw-r--r--test/unit.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/unit.py b/test/unit.py
index c3efef26..e88ed684 100644
--- a/test/unit.py
+++ b/test/unit.py
@@ -117,6 +117,12 @@ class TestUnit(unittest.TestCase):
except:
m = None
+ elif module == 'node':
+ if os.path.isdir(self.pardir + '/node/node_modules'):
+ m = module
+ else:
+ m = None
+
elif module == 'openssl':
try:
subprocess.check_output(['which', 'openssl'])
@@ -558,6 +564,35 @@ class TestUnitApplicationGo(TestUnitApplicationProto):
}
})
+class TestUnitApplicationNode(TestUnitApplicationProto):
+ def load(self, script, name='app.js'):
+
+ # copy application
+
+ shutil.copytree(self.current_dir + '/node/' + script,
+ self.testdir + '/node')
+
+ # link modules
+
+ os.symlink(self.pardir + '/node/node_modules',
+ self.testdir + '/node/node_modules')
+
+ self.conf({
+ "listeners": {
+ "*:7080": {
+ "application": script
+ }
+ },
+ "applications": {
+ script: {
+ "type": "external",
+ "processes": { "spare": 0 },
+ "working_directory": self.testdir + '/node',
+ "executable": name
+ }
+ }
+ })
+
class TestUnitApplicationPerl(TestUnitApplicationProto):
def load(self, script, name='psgi.pl'):
self.conf({