Skip to content

Commit 12cfa91

Browse files
committed
try modified privatelink
1 parent 846fe3e commit 12cfa91

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

test/integ/test_connection.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def test_us_west_connection(tmpdir, conn_cnx):
455455

456456

457457
@pytest.mark.timeout(60)
458-
def test_privatelink(db_parameters):
458+
def test_privatelink(conn_cnx):
459459
"""Ensure the OCSP cache server URL is overridden if privatelink connection is used."""
460460
try:
461461
os.environ["SF_OCSP_FAIL_OPEN"] = "false"
@@ -477,20 +477,13 @@ def test_privatelink(db_parameters):
477477
"ocsp_response_cache.json"
478478
)
479479

480-
cnx = snowflake.connector.connect(
481-
user=db_parameters["user"],
482-
password=db_parameters["password"],
483-
host=db_parameters["host"],
484-
port=db_parameters["port"],
485-
account=db_parameters["account"],
486-
database=db_parameters["database"],
487-
protocol=db_parameters["protocol"],
488-
timezone="UTC",
489-
)
490-
assert cnx, "invalid cnx"
480+
# Test that normal connections don't set the privatelink OCSP URL
481+
with conn_cnx(timezone="UTC") as cnx:
482+
assert cnx, "invalid cnx"
491483

492-
ocsp_url = os.getenv("SF_OCSP_RESPONSE_CACHE_SERVER_URL")
493-
assert ocsp_url is None, f"OCSP URL should be None: {ocsp_url}"
484+
ocsp_url = os.getenv("SF_OCSP_RESPONSE_CACHE_SERVER_URL")
485+
assert ocsp_url is None, f"OCSP URL should be None: {ocsp_url}"
486+
494487
del os.environ["SF_OCSP_DO_RETRY"]
495488
del os.environ["SF_OCSP_FAIL_OPEN"]
496489

0 commit comments

Comments
 (0)