File tree 1 file changed +8
-18
lines changed
plotly/tests/test_optional/test_offline
1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -52,15 +52,7 @@ def test_iplot_mpl_works_after_you_call_init_notebook_mode(self):
52
52
plotly .offline .iplot_mpl (fig )
53
53
54
54
55
- @attr ('matplotlib' )
56
55
class PlotlyOfflineMPLTestCase (TestCase ):
57
- # Generate matplotlib plot for tests
58
- fig = plt .figure ()
59
-
60
- x = [10 , 20 , 30 ]
61
- y = [100 , 200 , 300 ]
62
- plt .plot (x , y , "o" )
63
-
64
56
def setUp (self ):
65
57
pass
66
58
@@ -71,7 +63,15 @@ def _read_html(self, file_url):
71
63
with open (file_url .replace ('file://' , '' ).replace (' ' , '' )) as f :
72
64
return f .read ()
73
65
66
+ @attr ('matplotlib' )
74
67
def test_default_mpl_plot_generates_expected_html (self ):
68
+ # Generate matplotlib plot for tests
69
+ fig = plt .figure ()
70
+
71
+ x = [10 , 20 , 30 ]
72
+ y = [100 , 200 , 300 ]
73
+ plt .plot (x , y , "o" )
74
+
75
75
figure = plotly .tools .mpl_to_plotly (fig )
76
76
data = figure ['data' ]
77
77
layout = figure ['layout' ]
@@ -88,13 +88,3 @@ def test_default_mpl_plot_generates_expected_html(self):
88
88
# and it's an <html> doc
89
89
self .assertTrue (html .startswith ('<html>' ) and html .endswith ('</html>' ))
90
90
91
- def test_including_plotlyjs (self ):
92
- html = self ._read_html (plotly .offline .plot_mpl (fig , include_plotlyjs = False ))
93
- self .assertTrue (PLOTLYJS not in html )
94
-
95
- def test_div_output (self ):
96
- html = plotly .offline .plot_mpl (fig , output_type = 'div' )
97
-
98
- self .assertTrue ('<html>' not in html and '</html>' not in html )
99
- self .assertTrue (html .startswith ('<div>' ) and html .endswith ('</div>' ))
100
-
You can’t perform that action at this time.
0 commit comments