Skip to content

Commit 5a9795f

Browse files
committed
fix credentials tests
1 parent 246fbc4 commit 5a9795f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

plotly/tests/test_core/test_plotly/test_credentials.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from unittest import TestCase
22
import plotly.plotly.plotly as py
33
import plotly.tools as tls
4+
import plotly.session as session
45

56

67
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']
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

Comments
 (0)