1
1
from unittest import TestCase
2
2
import plotly .plotly .plotly as py
3
3
import plotly .tools as tls
4
+ import plotly .session as session
4
5
5
6
6
7
def test_get_credentials ():
7
- if 'username' in py ._credentials :
8
- del py ._credentials ['username' ]
9
- if 'api_key' in py ._credentials :
10
- del py ._credentials ['api_key' ]
8
+ session_credentials = session .get_session_credentials ()
9
+ if 'username' in session_credentials :
10
+ del session ._session ['credentials' ]['username' ]
11
+ if 'api_key' in session_credentials :
12
+ del session ._session ['credentials' ]['api_key' ]
11
13
creds = py .get_credentials ()
12
14
file_creds = tls .get_credentials_file ()
13
15
print (creds )
@@ -34,9 +36,11 @@ def test_get_config(self):
34
36
plotly_domain = 'test domain'
35
37
plotly_streaming_domain = 'test streaming domain'
36
38
config1 = py .get_config ()
37
- py . _config ['plotly_domain' ] = plotly_domain
39
+ session . _session [ 'config' ] ['plotly_domain' ] = plotly_domain
38
40
config2 = py .get_config ()
39
- py ._config ['plotly_streaming_domain' ] = plotly_streaming_domain
41
+ session ._session ['config' ]['plotly_streaming_domain' ] = (
42
+ plotly_streaming_domain
43
+ )
40
44
config3 = py .get_config ()
41
45
self .assertEqual (config2 ['plotly_domain' ], plotly_domain )
42
46
self .assertNotEqual (
0 commit comments