Ejemplo n.º 1
0
 def test_two_wkb(self):
     wb2 = Workbook(app_visible=False, app_target=APP_TARGET)
     pic1 = Picture.add(sheet=1, name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'))
     pic2 = Picture.add(sheet=1, name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'), wkb=self.wb)
     assert_equal(pic1.name, 'pic1')
     assert_equal(pic2.name, 'pic1')
     wb2.close()
Ejemplo n.º 2
0
    def test_top(self):
        pic = Picture.add(name='pic1',
                          filename=os.path.join(this_dir,
                                                'sample_picture.png'))
        assert_equal(pic.left, 0)

        pic.top = 20
        assert_equal(pic.top, 20)
Ejemplo n.º 3
0
    def test_name(self):
        pic = Picture.add(name='pic1',
                          filename=os.path.join(this_dir,
                                                'sample_picture.png'))
        assert_equal(pic.name, 'pic1')

        pic.name = 'pic_new'
        assert_equal(pic.name, 'pic_new')
Ejemplo n.º 4
0
    def test_height(self):
        pic = Picture.add(name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'))
        if PIL:
            assert_equal(pic.height, 60)
        else:
            assert_equal(pic.height, 100)

        pic.height = 50
        assert_equal(pic.height, 50)
Ejemplo n.º 5
0
    def test_width(self):
        pic = Picture.add(name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'))
        if PIL:
            assert_equal(pic.width, 60)
        else:
            assert_equal(pic.width, 100)

        pic.width = 50
        assert_equal(pic.width, 50)
Ejemplo n.º 6
0
 def test_picture_update(self):
     pic1 = Picture.add(os.path.join(this_dir, 'sample_picture.png'),
                        name='pic1')
     pic1.update(os.path.join(this_dir, 'sample_picture.png'))
Ejemplo n.º 7
0
 def test_duplicate(self):
     pic1 = Picture.add(os.path.join(this_dir, 'sample_picture.png'),
                        name='pic1')
     pic2 = Picture.add(os.path.join(this_dir, 'sample_picture.png'),
                        name='pic1')
Ejemplo n.º 8
0
 def test_delete(self):
     pic = Picture.add(name='pic1',
                       filename=os.path.join(this_dir,
                                             'sample_picture.png'))
     pic.delete()
     pic.name
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 def test_picture_update(self):
     pic1 = Picture.add(os.path.join(this_dir, 'sample_picture.png'), name='pic1')
     pic1.update(os.path.join(this_dir, 'sample_picture.png'))
Ejemplo n.º 11
0
 def test_duplicate(self):
     pic1 = Picture.add(os.path.join(this_dir, 'sample_picture.png'), name='pic1')
     pic2 = Picture.add(os.path.join(this_dir, 'sample_picture.png'), name='pic1')
Ejemplo n.º 12
0
 def test_delete(self):
     pic = Picture.add(name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'))
     pic.delete()
     pic.name
Ejemplo n.º 13
0
 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)
Ejemplo n.º 14
0
    def test_top(self):
        pic = Picture.add(name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'))
        assert_equal(pic.left, 0)

        pic.top = 20
        assert_equal(pic.top, 20)
Ejemplo n.º 15
0
    def test_name(self):
        pic = Picture.add(name='pic1', filename=os.path.join(this_dir, 'sample_picture.png'))
        assert_equal(pic.name, 'pic1')

        pic.name = 'pic_new'
        assert_equal(pic.name, 'pic_new')