def test_add_plot(self): _skip_if_no_matplotlib() fig = Figure(figsize=(8, 6)) ax = fig.add_subplot(111) ax.plot([1, 2, 3, 4, 5]) plot = Plot(fig) pic = plot.show('Plot1') assert_equal(pic.name, 'Plot1') plot.show('Plot2', sheet=2) pic2 = Picture(2, 'Plot2') assert_equal(pic2.name, 'Plot2')
def test_picture_object(self): pic = Picture.add(name='pic1', filename=os.path.join(this_dir, 'sample_picture.png')) assert_equal(pic.name, Picture('pic1').name)