From 4fbf521f1c6c71621f882f89c0c4946c10ee13ac Mon Sep 17 00:00:00 2001 From: Oscar Pacheco Date: Fri, 20 Sep 2024 10:04:15 -0600 Subject: [PATCH] Remove explicit reference to CMySQLConnection from the cipher tests Change-Id: I8e607b789b880b290081011a41a57e37dead5295 --- .../tests/qa/test_qa_ciphers.py | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/mysql-connector-python/tests/qa/test_qa_ciphers.py b/mysql-connector-python/tests/qa/test_qa_ciphers.py index 684aa839..43dcfb39 100644 --- a/mysql-connector-python/tests/qa/test_qa_ciphers.py +++ b/mysql-connector-python/tests/qa/test_qa_ciphers.py @@ -523,7 +523,7 @@ def _test_tls_ciphersuites( if verify: self.assertEqual(ssl_cipher, tls_ciphersuites[0]) - @tests.foreach_cnx(mysql.connector.MySQLConnection) + @tests.foreach_cnx() def test_tls_v12_ciphers(self): # verify=True means the test checks the selected cipher matches # with the one returned by the server. @@ -532,37 +532,20 @@ def test_tls_v12_ciphers(self): tls_versions=["TLSv1.2"], test_case=test_case, verify=True ) - @tests.foreach_cnx(mysql.connector.MySQLConnection) + @tests.foreach_cnx() def test_tls_v13_ciphers(self): # verify=True means the test checks the selected cipher matches # with the one returned by the server. + verify = True + if isinstance(self.cnx, mysql.connector.MySQLConnection): + verify = False + for test_case in self.tls_v13_cases: # verification should be False since cipher selection # for TLSv1.3 isn't supported. self._test_tls_ciphersuites( - tls_versions=["TLSv1.3"], test_case=test_case, verify=False - ) - self._test_tls_ciphersuites( - tls_versions=None, test_case=test_case, verify=False - ) - - @tests.foreach_cnx(mysql.connector.CMySQLConnection) - def test_tls_v12_ciphers_cext(self): - # verify=True means the test checks the selected cipher matches - # with the one returned by the server. - for test_case in self.tls_v12_cases: - self._test_tls_ciphersuites( - tls_versions=["TLSv1.2"], test_case=test_case, verify=True - ) - - @tests.foreach_cnx(mysql.connector.CMySQLConnection) - def test_tls_v13_ciphers_cext(self): - # verify=True means the test checks the selected cipher matches - # with the one returned by the server. - for test_case in self.tls_v13_cases: - self._test_tls_ciphersuites( - tls_versions=["TLSv1.3"], test_case=test_case, verify=True + tls_versions=["TLSv1.3"], test_case=test_case, verify=verify ) self._test_tls_ciphersuites( - tls_versions=None, test_case=test_case, verify=True + tls_versions=None, test_case=test_case, verify=verify )