8000 made corruption and added a test to test_session · modulexcite/plotly.py@772c106 · GitHub
[go: up one dir, main page]

Skip to content

Commit 772c106

Browse files
committed
made corruption and added a test to test_session
1 parent 81d86e8 commit 772c106

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

plotly/tests/test_core/test_session/test_session.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,28 @@
22

33
from unittest import TestCase
44

5-
from plotly.session import update_session_plot_options
5+
from plotly.session import (update_session_plot_options, SHARING_OPTIONS,
6+
_session)
67
from plotly.exceptions import PlotlyError
78

89

910
class TestSession(TestCase):
1011

11-
def test_update_session_plot_options_sharing(self):
12+
def test_update_session_plot_options_invalid_sharing_argument(self):
1213

1314
# Return PlotlyError when sharing arguement is not
1415
# 'public', 'private' or 'secret'
1516

1617
kwargs = {'sharing': 'priva'}
1718
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)

0 commit comments

Comments
 (0)
0