def test_basic(self): p1 = Plot("p1", "image.png", thumbnail="thumb.png") p2 = Plot("p2", "image2.png", thumbnail="thumb2.png") plots = [p1, p2] title = "My Plots" legend = "Legend" thumbnail = p1.thumbnail pg = PlotGroup("my_id", title=title, legend=legend, thumbnail=thumbnail, plots=plots) d = pg.to_dict() validate_plot_group(d) self.assertIsNotNone(d)
def test_basic(self): p1 = Plot('p1', 'image.png', thumbnail='thumb.png') p2 = Plot('p2', 'image2.png', thumbnail='thumb2.png') plots = [p1, p2] title = "My Plots" legend = "Legend" thumbnail = p1.thumbnail pg = PlotGroup('my_id', title=title, legend=legend, thumbnail=thumbnail, plots=plots) d = pg.to_dict() validate_plot_group(d) self.assertIsNotNone(d)
def test_to_dict(self): """Test plotGroup to_dict function.""" a = PlotGroup('123', title='foo title', legend='foo legend', thumbnail='foo thumbnail') a.add_plot(Plot('id', 'i1', caption='a caption')) d = a.to_dict() log.debug(pformat(d)) self.assertEquals('123', d['id']) self.assertEquals('foo title', d['title']) self.assertEquals('foo legend', d['legend']) self.assertEquals('foo thumbnail', d['thumbnail']) self.assertEquals(1, len(d['plots'])) log.info(a) self.assertIsNotNone(repr(a))
def test_to_dict(self): """Test plotGroup to_dict function.""" a = PlotGroup('123', title='foo title', legend='foo legend', thumbnail='foo thumbnail') a.add_plot(Plot('id', 'i1', caption='a caption')) d = a.to_dict() log.debug(pformat(d)) assert '123' == d['id'] assert 'foo title' == d['title'] assert 'foo legend' == d['legend'] assert 'foo thumbnail' == d['thumbnail'] assert 1 == len(d['plots']) log.info(a) assert repr(a) is not None