forked from snowflakedb/snowflake-connector-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_unit_construct_hostname.py
More file actions
30 lines (21 loc) · 1.01 KB
/
test_unit_construct_hostname.py
File metadata and controls
30 lines (21 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2018 Snowflake Computing Inc. All right reserved.
#
from snowflake.connector.util_text import construct_hostname
def test_construct_hostname_basic():
assert construct_hostname('eu-central-1', 'account1') == \
'account1.eu-central-1.snowflakecomputing.com'
assert construct_hostname('', 'account1') == \
'account1.snowflakecomputing.com'
assert construct_hostname(None, 'account1') == \
'account1.snowflakecomputing.com'
assert construct_hostname('as-east-3', 'account1') == \
'account1.as-east-3.snowflakecomputing.com'
assert construct_hostname('as-east-3', 'account1.eu-central-1') == \
'account1.as-east-3.snowflakecomputing.com'
assert construct_hostname('', 'account1.eu-central-1') == \
'account1.eu-central-1.snowflakecomputing.com'
assert construct_hostname(None, 'account1.eu-central-1') == \
'account1.eu-central-1.snowflakecomputing.com'