Skip to content

Commit

Permalink
i
Browse files Browse the repository at this point in the history
  • Loading branch information
tlocke committed Mar 31, 2024
1 parent 8cc4925 commit 80a6502
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/native/auth/test_scram-sha-256_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,36 @@ def setup(con):
pass


def test_scram_sha_256_plus(db_kwargs):
def test_scram_sha_256_plus(setup, db_kwargs):
db_kwargs["database"] = DB

con = Connection(**db_kwargs)
assert isinstance(con._usock, SSLSocket)
with Connection(**db_kwargs) as con:
assert isinstance(con._usock, SSLSocket)


def test_scram_sha_256_plus_ssl_True(db_kwargs):
def test_scram_sha_256_plus_ssl_True(setup, db_kwargs):
db_kwargs["ssl_context"] = True
db_kwargs["database"] = DB

con = Connection(**db_kwargs)
assert isinstance(con._usock, SSLSocket)
with Connection(**db_kwargs) as con:
assert isinstance(con._usock, SSLSocket)


def test_scram_sha_256_plus_ssl_custom(db_kwargs):
def test_scram_sha_256_plus_ssl_custom(setup, db_kwargs):
context = create_default_context()
context.check_hostname = False
context.verify_mode = CERT_NONE

db_kwargs["ssl_context"] = context
db_kwargs["database"] = DB

con = Connection(**db_kwargs)
assert isinstance(con._usock, SSLSocket)
with Connection(**db_kwargs) as con:
assert isinstance(con._usock, SSLSocket)


def test_scram_sha_256_plus_ssl_False(db_kwargs):
def test_scram_sha_256_plus_ssl_False(setup, db_kwargs):
db_kwargs["ssl_context"] = False
db_kwargs["database"] = DB

con = Connection(**db_kwargs)
assert not isinstance(con._usock, SSLSocket)
with Connection(**db_kwargs) as con:
assert not isinstance(con._usock, SSLSocket)

0 comments on commit 80a6502

Please sign in to comment.