diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-09-21 10:32:14 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-09-21 10:32:14 +0300 |
commit | af964488bad7fe00855749520d929ea1cb0de9d4 (patch) | |
tree | 4a6f961f6197c9e26b3b3d667c41e0c39e0d90e3 /test/test_python_application.py | |
parent | 7842c2d980512c10e23317da6261dad6bb9dffcc (diff) | |
download | unit-af964488bad7fe00855749520d929ea1cb0de9d4.tar.gz unit-af964488bad7fe00855749520d929ea1cb0de9d4.tar.bz2 |
Tests: changing Python application callable name.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r-- | test/test_python_application.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py index d1079116..e6ad6a01 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -797,3 +797,31 @@ last line: 987654321 obj = self.getjson()['body'] assert obj['UID'] == nobody_uid, 'root uid group=root' assert obj['GID'] == 0, 'root gid group=root' + + def test_python_application_callable(self): + skip_alert(r'Python failed to get "blah" from module') + self.load('callable') + + assert self.get()['status'] == 204, 'default application response' + + assert 'success' in self.conf( + '"app"', 'applications/callable/callable' + ) + + assert self.get()['status'] == 200, 'callable response' + + assert 'success' in self.conf( + '"blah"', 'applications/callable/callable' + ) + + assert self.get()['status'] not in [200, 204], 'callable response inv' + + assert 'success' in self.conf( + '"app"', 'applications/callable/callable' + ) + + assert self.get()['status'] == 200, 'callable response 2' + + assert 'success' in self.conf_delete('applications/callable/callable') + + assert self.get()['status'] == 204, 'default response 2' |