11from unittest import TestCase
22import plotly .plotly .plotly as py
33import plotly .tools as tls
4+ import plotly .session as session
45
56
67def 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' ]
1113 creds = py .get_credentials ()
1214 file_creds = tls .get_credentials_file ()
1315 print (creds )
@@ -34,9 +36,11 @@ def test_get_config(self):
3436 plotly_domain = 'test domain'
3537 plotly_streaming_domain = 'test streaming domain'
3638 config1 = py .get_config ()
37- py . _config ['plotly_domain' ] = plotly_domain
39+ session . _session [ 'config' ] ['plotly_domain' ] = plotly_domain
3840 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+ )
4044 config3 = py .get_config ()
4145 self .assertEqual (config2 ['plotly_domain' ], plotly_domain )
4246 self .assertNotEqual (
0 commit comments