Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)