Skip to content

Commit dc6a9fe

Browse files
committed
SNOW-27732: added test case for set_proxies
1 parent 5535236 commit dc6a9fe

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/test_unit_proxies.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# encoding=utf-8
2+
# !/usr/bin/env python
3+
#
4+
# Copyright (c) 2012-2017 Snowflake Computing Inc. All right reserved.
5+
#
6+
7+
8+
def test_set_proxies():
9+
from snowflake.connector.ssl_wrap_socket import set_proxies
10+
11+
assert set_proxies('proxyhost', '8080') == {
12+
'http': 'http://proxyhost:8080',
13+
'https': 'http://proxyhost:8080',
14+
}
15+
assert set_proxies('http://proxyhost', '8080') == {
16+
'http': 'http://proxyhost:8080',
17+
'https': 'http://proxyhost:8080',
18+
}
19+
assert set_proxies('http://proxyhost', '8080', 'testuser', 'testpass') == {
20+
'http': 'http://testuser:testpass@proxyhost:8080',
21+
'https': 'http://testuser:testpass@proxyhost:8080',
22+
}
23+
assert set_proxies('proxyhost', '8080', 'testuser', 'testpass') == {
24+
'http': 'http://testuser:testpass@proxyhost:8080',
25+
'https': 'http://testuser:testpass@proxyhost:8080',
26+
}

0 commit comments

Comments
 (0)