Skip to content

Commit 6b23446

Browse files
committed
Add a test for get_config()
1 parent e5a0493 commit 6b23446

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

plotly/tests/test_core/test_plotly/test_credentials.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from unittest import TestCase
12
import plotly.plotly.plotly as py
23
import plotly.tools as tls
34

@@ -24,4 +25,23 @@ def test_sign_in():
2425
assert creds['username'] == un
2526
assert creds['api_key'] == ak
2627
# TODO, and check it!
27-
# assert creds['stream_ids'] == si
28+
# assert creds['stream_ids'] == si
29+
30+
31+
class TestSignIn(TestCase):
32+
33+
def test_get_config(self):
34+
plotly_domain = 'test domain'
35+
plotly_streaming_domain = 'test streaming domain'
36+
config1 = py.get_config()
37+
py._config['plotly_domain'] = plotly_domain
38+
config2 = py.get_config()
39+
py._config['plotly_streaming_domain'] = plotly_streaming_domain
40+
config3 = py.get_config()
41+
self.assertEqual(config2['plotly_domain'], plotly_domain)
42+
self.assertNotEqual(
43+
config2['plotly_streaming_domain'], plotly_streaming_domain
44+
)
45+
self.assertEqual(
46+
config3['plotly_streaming_domain'], plotly_streaming_domain
47+
)

0 commit comments

Comments
 (0)