def test_init_with_thumbnail(self): """Initial with thumbnail""" image = "my_image.png" thumbnail = "my_image_thumb.png" p = Plot('plot_1', image, thumbnail=thumbnail, caption="Awesome image") self.assertEqual(p.thumbnail, thumbnail) log.info(pformat(p.to_dict())) self.assertTrue(isinstance(p.to_dict(), dict))
def test_to_dict(self): """Test plot to dictionary method""" a = Plot('123', 'foo', caption='foo is the caption') d = a.to_dict() self.assertEquals('123', d['id']) self.assertEquals('foo', d['image']) self.assertEquals('foo is the caption', d['caption']) log.info(pformat(d, indent=4)) log.info(repr(a)) self.assertIsNotNone(repr(a))
def test_to_dict(self): """Test plot to dictionary method""" a = Plot('123', 'foo', caption='foo is the caption') d = a.to_dict() assert '123' == d['id'] assert 'foo' == d['image'] assert 'foo is the caption' == d['caption'] assert Plot.PLOT_TYPE == d['plotType'] log.info(pformat(d, indent=4)) log.info(repr(a)) assert repr(a) is not None
def test_basic(self): image = 'image.png' p = Plot('my_id', image, caption="Caption", thumbnail=image) d = p.to_dict() validate_plot(d)
def test_basic(self): image = "image.png" p = Plot("my_id", image, caption="Caption", thumbnail=image) d = p.to_dict() validate_plot(d)