Skip to content

Commit e1d9bab

Browse files
committed
test: fix connect_helper assertions for Windows paths with host in protocol URLs
1 parent 8d806d7 commit e1d9bab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ def test_connect_helper():
8484
dsn = driver.core._connect_helper(None, IP, None, DB_LINUX_PATH, NetProtocol.INET)
8585
assert dsn == f'inet://{IP}/{DB_LINUX_PATH}' # Double slash for absolute path
8686
dsn = driver.core._connect_helper(None, HOST, None, DB_WIN_PATH, NetProtocol.INET)
87-
assert dsn == f'inet://{HOST}{DB_WIN_PATH}'
87+
assert dsn == f'inet://{HOST}/{DB_WIN_PATH}'
8888
# 3. TCP/IP with Port
8989
dsn = driver.core._connect_helper(None, HOST, PORT, DB_ALIAS, NetProtocol.INET)
9090
assert dsn == f'inet://{HOST}:{PORT}/{DB_ALIAS}'
9191
dsn = driver.core._connect_helper(None, IP, PORT, DB_LINUX_PATH, NetProtocol.INET)
9292
assert dsn == f'inet://{IP}:{PORT}/{DB_LINUX_PATH}' # Double slash for absolute path
9393
dsn = driver.core._connect_helper(None, HOST, SVC_NAME, DB_WIN_PATH, NetProtocol.INET)
94-
assert dsn == f'inet://{HOST}:{SVC_NAME}{DB_WIN_PATH}'
94+
assert dsn == f'inet://{HOST}:{SVC_NAME}/{DB_WIN_PATH}'
9595
# 4. Named pipes
9696
dsn = driver.core._connect_helper(None, NPIPE_HOST, None, DB_ALIAS, NetProtocol.WNET)
9797
assert dsn == f'wnet://{NPIPE_HOST}/{DB_ALIAS}'
9898
dsn = driver.core._connect_helper(None, NPIPE_HOST, SVC_NAME, DB_WIN_PATH, NetProtocol.WNET)
99-
assert dsn == f'wnet://{NPIPE_HOST}:{SVC_NAME}{DB_WIN_PATH}'
99+
assert dsn == f'wnet://{NPIPE_HOST}:{SVC_NAME}/{DB_WIN_PATH}'
100100

101101
def test_connect_dsn(dsn, db_file):
102102
with connect(dsn) as con:

0 commit comments

Comments
 (0)