Skip to content

Commit

Permalink
Add unit test for TABPY_MINIMUM_TLS_VERSION config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeichikawasalesforce committed Jun 19, 2024
1 parent 7e0c71d commit 8adedbd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/server_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@ def test_gzip_setting_off_valid(
app = TabPyApp(self.config_file.name)
self.assertEqual(app.settings["gzip_enabled"], False)

@patch("tabpy.tabpy_server.app.app.os.path.exists", return_value=True)
@patch("tabpy.tabpy_server.app.app._get_state_from_file")
@patch("tabpy.tabpy_server.app.app.TabPyState")
def test_min_tls_setting_valid(
self, mock_state, mock_get_state_from_file, mock_path_exists
):
self.assertTrue(self.config_file is not None)
config_file = self.config_file
config_file.write("[TabPy]\n" "TABPY_MINIMUM_TLS_VERSION = TLSv1_3".encode())
config_file.close()

app = TabPyApp(self.config_file.name)
self.assertEqual(app.settings["minimum_tls_version"], "TLSv1_3")

class TestTransferProtocolValidation(unittest.TestCase):
def assertTabPyAppRaisesRuntimeError(self, expected_message):
with self.assertRaises(RuntimeError) as err:
Expand Down

0 comments on commit 8adedbd

Please sign in to comment.