forked from snowflakedb/snowflake-connector-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_session_parameters.py
More file actions
28 lines (26 loc) · 823 Bytes
/
Copy pathtest_session_parameters.py
File metadata and controls
28 lines (26 loc) · 823 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
import snowflake.connector
def test_session_parameters(db_parameters):
"""
Set the session parameters in connection time
"""
connection = snowflake.connector.connect(
protocol=db_parameters['protocol'],
account=db_parameters['account'],
user=db_parameters['user'],
password=db_parameters['password'],
host=db_parameters['host'],
port=db_parameters['port'],
database=db_parameters['database'],
schema=db_parameters['schema'],
session_parameters={
'TIMEZONE': 'UTC'
}
)
ret = connection.cursor().execute(
"show parameters like 'TIMEZONE'").fetchone()
assert ret[1] == 'UTC'