Skip to content

Commit

Permalink
Skip cert validation test on local machine #442
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Aug 8, 2024
1 parent b57c569 commit 413da6d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,20 @@ def test_client_revision(self):
client.execute('SELECT 1')

def test_client_with_no_cert_validation(self):
try:
self.client.execute('SELECT showCertificate()')
except errors.ServerException as e:
# If there is no such function skip this check.
if e.code == errors.ErrorCodes.UNKNOWN_FUNCTION:
pass

# If certificate not found
elif e.code == errors.ErrorCodes.POCO_EXCEPTION and \
'No such file or directory' in e.message:
self.skipTest('No certificate found on ClickHouse server')
else:
raise

with self.created_client(port=self.secure_port,
secure=True, verify=False) as client:
client.execute('SELECT 1')
Expand Down

0 comments on commit 413da6d

Please sign in to comment.