Skip to content

Commit

Permalink
Remove explicit reference to CMySQLConnection from the cipher tests
Browse files Browse the repository at this point in the history
Change-Id: I8e607b789b880b290081011a41a57e37dead5295
  • Loading branch information
oscpache committed Sep 20, 2024
1 parent db3d07d commit 4fbf521
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions mysql-connector-python/tests/qa/test_qa_ciphers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
)

0 comments on commit 4fbf521

Please sign in to comment.