Exemple #1
0
 def test_update_validation_error(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     update = {"invalid": "anything"}
     with pytest.raises(KeyError):
         py.plot_mpl(fig,
                     update=update,
                     filename="nosetests",
                     auto_open=False)
Exemple #2
0
 def test_update_type_error(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     update = []
     with pytest.raises(_plotly_utils.exceptions.PlotlyGraphObjectError):
         py.plot_mpl(fig,
                     update=update,
                     filename="nosetests",
                     auto_open=False)
Exemple #3
0
 def test_update(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     title = "new title"
     update = {"layout": {"title": title}}
     url = py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)
     un = url.replace("https://plot.ly/~", "").split("/")[0]
     fid = url.replace("https://plot.ly/~", "").split("/")[1]
     pfig = py.get_figure(un, fid)
     assert pfig["layout"]["title"]["text"] == title
Exemple #4
0
 def test_update(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     title = 'new title'
     update = {'layout': {'title': title}}
     url = py.plot_mpl(fig, update=update, filename="nosetests",
                       auto_open=False)
     un = url.replace("https://plot.ly/~", "").split('/')[0]
     fid = url.replace("https://plot.ly/~", "").split('/')[1]
     pfig = py.get_figure(un, fid)
     assert pfig['layout']['title']['text'] == title
Exemple #5
0
 def test_update_type_error(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     update = []
     py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)
Exemple #6
0
 def test_update_validation_error(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     update = {'invalid': 'anything'}
     py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)
Exemple #7
0
 def test_update_type_error(self):
     fig, ax = plt.subplots()
     ax.plot([1, 2, 3])
     update = []
     py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)