From 5f8d58d2a4f226db92619c447289ddbace19961f Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Fri, 19 May 2023 18:27:41 +0100 Subject: Tests: added tests for "server_version" option. --- test/test_settings.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') 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') -- cgit