Tests: supporting instant app parameters in load().

This commit is contained in:
Max Romanov
2020-11-10 22:27:08 +03:00
parent b2771702fb
commit a8a9d80f8d
3 changed files with 37 additions and 89 deletions

View File

@@ -34,20 +34,24 @@ class TestApplicationPython(TestApplicationProto):
script_path = '/app/python/' + name
app = {
"type": self.get_application_type(),
"processes": kwargs.pop('processes', {"spare": 0}),
"path": script_path,
"working_directory": script_path,
"module": module,
}
for attr in ('callable', 'home', 'limits', 'path', 'threads'):
if attr in kwargs:
app[attr] = kwargs.pop(attr)
self._load_conf(
{
"listeners": {
"*:7080": {"pass": "applications/" + quote(name, '')}
},
"applications": {
name: {
"type": self.get_application_type(),
"processes": {"spare": 0},
"path": script_path,
"working_directory": script_path,
"module": module,
}
},
"applications": {name: app},
},
**kwargs
)