Skip to content

Commit cd50e9e

Browse files
Add integration test for TABPY_MINIMUM_TLS_VERSION not set.
1 parent 371c11f commit cd50e9e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/integration/test_minimum_tls_version.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ def _get_config_file_name(self, tls_version: str) -> str:
1414
"TABPY_TRANSFER_PROTOCOL = https\n"
1515
"TABPY_CERTIFICATE_FILE = ./tests/integration/resources/2019_04_24_to_3018_08_25.crt\n"
1616
"TABPY_KEY_FILE = ./tests/integration/resources/2019_04_24_to_3018_08_25.key\n"
17-
f"TABPY_MINIMUM_TLS_VERSION = {tls_version}"
1817
)
18+
19+
if tls_version is not None:
20+
config_file.write(f"TABPY_MINIMUM_TLS_VERSION = {tls_version}")
21+
1922
pwd_file = self._get_pwd_file()
2023
if pwd_file is not None:
2124
pwd_file = os.path.abspath(pwd_file)
@@ -41,3 +44,11 @@ def test_minimum_tls_version_invalid(self):
4144
log_contents = self._get_log_contents()
4245
self.assertIn("Unrecognized value for TABPY_MINIMUM_TLS_VERSION", log_contents)
4346
self.assertIn("Setting minimum TLS version to TLSv1_2", log_contents)
47+
48+
class TestMinimumTLSVersionNotSpecified(TestMinimumTLSVersion):
49+
def _get_config_file_name(self) -> str:
50+
return super()._get_config_file_name(None)
51+
52+
def test_minimum_tls_version_invalid(self):
53+
log_contents = self._get_log_contents()
54+
self.assertIn("Setting minimum TLS version to TLSv1_2", log_contents)

0 commit comments

Comments
 (0)