1from unit.applications.proto import TestApplicationProto
2
3
4class TestApplicationPython(TestApplicationProto):
5 application_type = "python"
6
7 def load(self, script, name=None):
7 def load(self, script, name=None, **kwargs):
8 if name is None:
9 name = script
10
11 script_path = self.current_dir + '/python/' + script
12
13 self._load_conf(
14 {
15 "listeners": {"*:7080": {"pass": "applications/" + name}},
16 "applications": {
17 name: {
18 "type": self.application_type,
19 "processes": {"spare": 0},
20 "path": script_path,
21 "working_directory": script_path,
22 "module": "wsgi",
23 }
24 },
25 }
25 },
26 **kwargs
27 )