Skip to content

Commit eba2228

Browse files
committed
feat: update ip type for connectors
1 parent 6ecf894 commit eba2228

File tree

7 files changed

+24
-8
lines changed

7 files changed

+24
-8
lines changed

tests/system/test_asyncpg_connection.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ async def create_sqlalchemy_engine(
8787
user=user,
8888
password=password,
8989
db=db,
90-
ip_type="public", # can also be "private" or "psc"
90+
ip_type=os.environ.get(
91+
"IP_TYPE", "public"
92+
), # can also be "private" or "psc"
9193
),
9294
execution_options={"isolation_level": "AUTOCOMMIT"},
9395
)
@@ -145,7 +147,9 @@ async def getconn(
145147
user=user,
146148
password=password,
147149
db=db,
148-
ip_type="public", # can also be "private" or "psc",
150+
ip_type=os.environ.get(
151+
"IP_TYPE", "public"
152+
), # can also be "private" or "psc",
149153
**kwargs,
150154
)
151155
return conn

tests/system/test_asyncpg_iam_auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ async def create_sqlalchemy_engine(
7171
"asyncpg",
7272
user=user,
7373
db=db,
74-
ip_type="public", # can also be "private" or "psc"
74+
ip_type=os.environ.get(
75+
"IP_TYPE", "public"
76+
), # can also be "private" or "psc"
7577
enable_iam_auth=True,
7678
),
7779
execution_options={"isolation_level": "AUTOCOMMIT"},

tests/system/test_pg8000_connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def create_sqlalchemy_engine(
8585
user=user,
8686
password=password,
8787
db=db,
88-
ip_type="public", # can also be "private" or "psc"
88+
ip_type=os.environ.get(
89+
"IP_TYPE", "public"
90+
), # can also be "private" or "psc"
8991
),
9092
)
9193
return engine, connector

tests/system/test_pg8000_iam_auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def create_sqlalchemy_engine(
7070
"pg8000",
7171
user=user,
7272
db=db,
73-
ip_type="public", # can also be "private" or "psc"
73+
ip_type=os.environ.get(
74+
"IP_TYPE", "public"
75+
), # can also be "private" or "psc"
7476
enable_iam_auth=True,
7577
),
7678
)

tests/system/test_pymysql_connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def create_sqlalchemy_engine(
7575
user=user,
7676
password=password,
7777
db=db,
78-
ip_type="public", # can also be "private" or "psc"
78+
ip_type=os.environ.get(
79+
"IP_TYPE", "public"
80+
), # can also be "private" or "psc"
7981
),
8082
)
8183
return engine, connector

tests/system/test_pymysql_iam_auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def create_sqlalchemy_engine(
7070
"pymysql",
7171
user=user,
7272
db=db,
73-
ip_type="public", # can also be "private" or "psc"
73+
ip_type=os.environ.get(
74+
"IP_TYPE", "public"
75+
), # can also be "private" or "psc"
7476
enable_iam_auth=True,
7577
),
7678
)

tests/system/test_pytds_connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ def create_sqlalchemy_engine(
7373
user=user,
7474
password=password,
7575
db=db,
76-
ip_type="public", # can also be "private" or "psc"
76+
ip_type=os.environ.get(
77+
"IP_TYPE", "public"
78+
), # can also be "private" or "psc"
7779
),
7880
)
7981
return engine, connector

0 commit comments

Comments
 (0)