summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications/lang
diff options
context:
space:
mode:
authorOisin Canty <o.canty@f5.com>2021-07-02 13:00:57 +0000
committerOisin Canty <o.canty@f5.com>2021-07-02 13:00:57 +0000
commit8c83652c2a0ad7386e27a9ea595c996d3dce018c (patch)
tree154281c0fc0216f5588f6a9c7f96a79c500737a5 /test/unit/applications/lang
parent6c14d5d7b1921bd78f2d1b7458eae7d97eee0fcd (diff)
downloadunit-8c83652c2a0ad7386e27a9ea595c996d3dce018c.tar.gz
unit-8c83652c2a0ad7386e27a9ea595c996d3dce018c.tar.bz2
Tests: Ruby hooks.
Diffstat (limited to 'test/unit/applications/lang')
-rw-r--r--test/unit/applications/lang/ruby.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/unit/applications/lang/ruby.py b/test/unit/applications/lang/ruby.py
index d95d62b4..61d50558 100644
--- a/test/unit/applications/lang/ruby.py
+++ b/test/unit/applications/lang/ruby.py
@@ -12,7 +12,7 @@ class TestApplicationRuby(TestApplicationProto):
def prepare_env(self, script):
shutil.copytree(
option.test_dir + '/ruby/' + script,
- option.temp_dir + '/ruby/' + script
+ option.temp_dir + '/ruby/' + script,
)
public_dir(option.temp_dir + '/ruby/' + script)
@@ -22,17 +22,23 @@ class TestApplicationRuby(TestApplicationProto):
script_path = option.temp_dir + '/ruby/' + script
+ app = {
+ "type": self.get_application_type(),
+ "processes": {"spare": 0},
+ "working_directory": script_path,
+ "script": script_path + '/' + name,
+ }
+
+ for key in [
+ 'hooks',
+ ]:
+ if key in kwargs:
+ app[key] = kwargs[key]
+
self._load_conf(
{
"listeners": {"*:7080": {"pass": "applications/" + script}},
- "applications": {
- script: {
- "type": self.get_application_type(),
- "processes": {"spare": 0},
- "working_directory": script_path,
- "script": script_path + '/' + name,
- }
- },
+ "applications": {script: app},
},
**kwargs
)