コード例 #1
0
    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))
コード例 #2
0
    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))
コード例 #3
0
 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))
コード例 #4
0
 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))
コード例 #5
0
 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
コード例 #6
0
 def test_basic(self):
     image = 'image.png'
     p = Plot('my_id', image, caption="Caption", thumbnail=image)
     d = p.to_dict()
     validate_plot(d)
コード例 #7
0
 def test_basic(self):
     image = "image.png"
     p = Plot("my_id", image, caption="Caption", thumbnail=image)
     d = p.to_dict()
     validate_plot(d)
コード例 #8
0
 def test_basic(self):
     image = 'image.png'
     p = Plot('my_id', image, caption="Caption", thumbnail=image)
     d = p.to_dict()
     validate_plot(d)