File tree Expand file tree Collapse file tree 1 file changed +8
-18
lines changed
plotly/tests/test_optional/test_offline Expand file tree Collapse file tree 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):
5252 plotly .offline .iplot_mpl (fig )
5353
5454
55- @attr ('matplotlib' )
5655class 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-
6456 def setUp (self ):
6557 pass
6658
@@ -71,7 +63,15 @@ def _read_html(self, file_url):
7163 with open (file_url .replace ('file://' , '' ).replace (' ' , '' )) as f :
7264 return f .read ()
7365
66+ @attr ('matplotlib' )
7467 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+
7575 figure = plotly .tools .mpl_to_plotly (fig )
7676 data = figure ['data' ]
7777 layout = figure ['layout' ]
@@ -88,13 +88,3 @@ def test_default_mpl_plot_generates_expected_html(self):
8888 # and it's an <html> doc
8989 self .assertTrue (html .startswith ('<html>' ) and html .endswith ('</html>' ))
9090
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