File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
tests/test_core/test_plotly Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 52
52
### _credentials stuff ###
53
53
54
54
55
- def sign_in (username , api_key ):
55
+ def sign_in (username , api_key , ** kwargs ):
56
56
"""Set module-scoped _credentials for session. Verify with plotly."""
57
57
global _credentials
58
58
_credentials ['username' ], _credentials ['api_key' ] = username , api_key
59
59
# TODO: verify these _credentials with plotly
60
60
61
+ global _config
62
+ _config ['plotly_domain' ] = kwargs .get ('plotly_domain' )
63
+ _config ['plotly_streaming_domain' ] = kwargs .get ('plotly_streaming_domain' )
64
+
61
65
62
66
### plot options stuff ###
63
67
Original file line number Diff line number Diff line change @@ -45,3 +45,20 @@ def test_get_config(self):
45
45
self .assertEqual (
46
46
config3 ['plotly_streaming_domain' ], plotly_streaming_domain
47
47
)
48
+
49
+ def test_sign_in_with_config (self ):
50
+ username = 'place holder'
51
+ api_key = 'place holder'
52
+ plotly_domain = 'test domain'
53
+ plotly_streaming_domain = 'test streaming domain'
54
+ py .sign_in (
55
+ username ,
56
+ api_key ,
57
+ plotly_domain = plotly_domain ,
58
+ plotly_streaming_domain = plotly_streaming_domain
59
+ )
60
+ config = py .get_config ()
61
+ self .assertEqual (config ['plotly_domain' ], plotly_domain )
62
+ self .assertEqual (
63
+ config ['plotly_streaming_domain' ], plotly_streaming_domain
64
+ )
You can’t perform that action at this time.
0 commit comments