File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
plotly/tests/test_core/test_session Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from unittest import TestCase
4
4
5
- from plotly .session import update_session_plot_options
5
+ from plotly .session import (update_session_plot_options , SHARING_OPTIONS ,
6
+ _session )
6
7
from plotly .exceptions import PlotlyError
7
8
8
9
9
10
class TestSession (TestCase ):
10
11
11
- def test_update_session_plot_options_sharing (self ):
12
+ def test_update_session_plot_options_invalid_sharing_argument (self ):
12
13
13
14
# Return PlotlyError when sharing arguement is not
14
15
# 'public', 'private' or 'secret'
15
16
16
17
kwargs = {'sharing' : 'priva' }
17
18
self .assertRaises (PlotlyError , update_session_plot_options , ** kwargs )
19
+
20
+ def test_update_session_plot_options_valid_sharing_argument (self ):
21
+
22
+ # _session['plot_options'] should contain sharing key after
23
+ # update_session_plot_options is called by correct arguments
24
+ # 'public, 'private' or 'secret'
25
+
26
+ for key in SHARING_OPTIONS :
27
+ kwargs = {'sharing' : key }
28
+ update_session_plot_options (** kwargs )
29
+ self .assertEqual (_session ['plot_options' ], kwargs )
You can’t perform that action at this time.
0 commit comments