diff options
author | Andrei Belov <defan@nginx.com> | 2020-11-19 21:19:57 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2020-11-19 21:19:57 +0300 |
commit | 7f9079a3cd4cdb6ac3fea53f10bd34fe8b82fe9c (patch) | |
tree | c79dc48a3260156f3f824ecd299e5a4934d749c5 /test/unit/applications/lang/python.py | |
parent | 646d047e5d12515ceac02279b373601ce0752982 (diff) | |
parent | 806a9b2515c60b12a68cd97af04f7fa5cb4dffed (diff) | |
download | unit-1.21.0-1.tar.gz unit-1.21.0-1.tar.bz2 |
Merged with the default branch.1.21.0-1
Diffstat (limited to 'test/unit/applications/lang/python.py')
-rw-r--r-- | test/unit/applications/lang/python.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/test/unit/applications/lang/python.py b/test/unit/applications/lang/python.py index 47b95dac..792a86fa 100644 --- a/test/unit/applications/lang/python.py +++ b/test/unit/applications/lang/python.py @@ -12,7 +12,6 @@ class TestApplicationPython(TestApplicationProto): load_module = "wsgi" def load(self, script, name=None, module=None, **kwargs): - print() if name is None: name = script @@ -35,25 +34,25 @@ class TestApplicationPython(TestApplicationProto): script_path = '/app/python/' + name - appication_type = self.get_appication_type() + app = { + "type": self.get_application_type(), + "processes": kwargs.pop('processes', {"spare": 0}), + "path": script_path, + "working_directory": script_path, + "module": module, + } - if appication_type is None: - appication_type = self.application_type + for attr in ('callable', 'home', 'limits', 'path', 'protocol', + 'threads'): + if attr in kwargs: + app[attr] = kwargs.pop(attr) self._load_conf( { "listeners": { "*:7080": {"pass": "applications/" + quote(name, '')} }, - "applications": { - name: { - "type": appication_type, - "processes": {"spare": 0}, - "path": script_path, - "working_directory": script_path, - "module": module, - } - }, + "applications": {name: app}, }, **kwargs ) |