summaryrefslogtreecommitdiffhomepage
path: root/test/test_settings.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-05-19 18:27:41 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-05-19 18:27:41 +0100
commit5f8d58d2a4f226db92619c447289ddbace19961f (patch)
tree1da8f82f2bd582c820c980f19f263721d982cd9f /test/test_settings.py
parentaa57254674e53f4e8c3e29fb95df98b4b4a8f105 (diff)
downloadunit-5f8d58d2a4f226db92619c447289ddbace19961f.tar.gz
unit-5f8d58d2a4f226db92619c447289ddbace19961f.tar.bz2
Tests: added tests for "server_version" option.
Diffstat (limited to 'test/test_settings.py')
-rw-r--r--test/test_settings.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_settings.py b/test/test_settings.py
index 21ab22d9..965f7197 100644
--- a/test/test_settings.py
+++ b/test/test_settings.py
@@ -70,6 +70,21 @@ class TestSettings(TestApplicationPython):
check_error({'large_header_buffers': -1})
check_error({'large_header_buffers': 0})
+ def test_settings_server_version(self):
+ self.load('empty')
+
+ assert self.get()['headers']['Server'].startswith('Unit/')
+
+ assert 'success' in self.conf(
+ {"http": {"server_version": False}}, 'settings'
+ ), 'remove version'
+ assert self.get()['headers']['Server'] == 'Unit'
+
+ assert 'success' in self.conf(
+ {"http": {"server_version": True}}, 'settings'
+ ), 'add version'
+ assert self.get()['headers']['Server'].startswith('Unit/')
+
def test_settings_header_read_timeout(self):
self.load('empty')