Skip to content

Commit 8adedbd

Browse files
Add unit test for TABPY_MINIMUM_TLS_VERSION config.
1 parent 7e0c71d commit 8adedbd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/unit/server_tests/test_config.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,20 @@ def test_gzip_setting_off_valid(
209209
app = TabPyApp(self.config_file.name)
210210
self.assertEqual(app.settings["gzip_enabled"], False)
211211

212+
@patch("tabpy.tabpy_server.app.app.os.path.exists", return_value=True)
213+
@patch("tabpy.tabpy_server.app.app._get_state_from_file")
214+
@patch("tabpy.tabpy_server.app.app.TabPyState")
215+
def test_min_tls_setting_valid(
216+
self, mock_state, mock_get_state_from_file, mock_path_exists
217+
):
218+
self.assertTrue(self.config_file is not None)
219+
config_file = self.config_file
220+
config_file.write("[TabPy]\n" "TABPY_MINIMUM_TLS_VERSION = TLSv1_3".encode())
221+
config_file.close()
222+
223+
app = TabPyApp(self.config_file.name)
224+
self.assertEqual(app.settings["minimum_tls_version"], "TLSv1_3")
225+
212226
class TestTransferProtocolValidation(unittest.TestCase):
213227
def assertTabPyAppRaisesRuntimeError(self, expected_message):
214228
with self.assertRaises(RuntimeError) as err:

0 commit comments

Comments
 (0)