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 5252### _credentials stuff ###
5353
5454
55- def sign_in (username , api_key ):
55+ def sign_in (username , api_key , ** kwargs ):
5656 """Set module-scoped _credentials for session. Verify with plotly."""
5757 global _credentials
5858 _credentials ['username' ], _credentials ['api_key' ] = username , api_key
5959 # TODO: verify these _credentials with plotly
6060
61+ global _config
62+ _config ['plotly_domain' ] = kwargs .get ('plotly_domain' )
63+ _config ['plotly_streaming_domain' ] = kwargs .get ('plotly_streaming_domain' )
64+
6165
6266### plot options stuff ###
6367
Original file line number Diff line number Diff line change @@ -45,3 +45,20 @@ def test_get_config(self):
4545 self .assertEqual (
4646 config3 ['plotly_streaming_domain' ], plotly_streaming_domain
4747 )
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