Example #1
0
def test_update():
    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'] == title
Example #2
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
Example #3
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)
Example #4
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)
Example #5
0
def test_update_validation_error():
    fig, ax = plt.subplots()
    ax.plot([1, 2, 3])
    update = {'invalid': 'anything'}
    py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)
Example #6
0
def test_update_type_error():
    fig, ax = plt.subplots()
    ax.plot([1, 2, 3])
    update = []
    py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)