Skip to content

Commit 846fe3e

Browse files
committed
try orginal privatelink
1 parent fcb3744 commit 846fe3e

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

test/integ/test_connection.py

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

456456

457457
@pytest.mark.timeout(60)
458-
def test_privatelink(conn_cnx):
458+
def test_privatelink(db_parameters):
459459
"""Ensure the OCSP cache server URL is overridden if privatelink connection is used."""
460460
try:
461461
os.environ["SF_OCSP_FAIL_OPEN"] = "false"
462462
os.environ["SF_OCSP_DO_RETRY"] = "false"
463-
with conn_cnx(
463+
snowflake.connector.connect(
464464
account="testaccount",
465465
user="testuser",
466466
password="testpassword",
467467
region="eu-central-1.privatelink",
468468
login_timeout=5,
469-
):
470-
pytest.fail("should not make connection")
471-
except (OperationalError, HttpError):
469+
)
470+
pytest.fail("should not make connection")
471+
except OperationalError:
472472
ocsp_url = os.getenv("SF_OCSP_RESPONSE_CACHE_SERVER_URL")
473473
assert ocsp_url is not None, "OCSP URL should not be None"
474474
assert (
@@ -477,11 +477,20 @@ def test_privatelink(conn_cnx):
477477
"ocsp_response_cache.json"
478478
)
479479

480-
with conn_cnx(timezone="UTC") as cnx:
481-
assert cnx, "invalid cnx"
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"
482491

483-
ocsp_url = os.getenv("SF_OCSP_RESPONSE_CACHE_SERVER_URL")
484-
assert ocsp_url is None, f"OCSP URL should be None: {ocsp_url}"
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}"
485494
del os.environ["SF_OCSP_DO_RETRY"]
486495
del os.environ["SF_OCSP_FAIL_OPEN"]
487496

0 commit comments

Comments
 (0)