This feature was not really needed as the exif metadata were just copied to the generated image. Moreover, this was depending on pyexiv2 which is now deprecated in favour of GExiv2.
36 lines
847 B
Python
36 lines
847 B
Python
# -*- coding:utf-8 -*-
|
|
|
|
import os
|
|
from tempfile import mkdtemp
|
|
from shutil import rmtree
|
|
|
|
try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest # NOQA
|
|
|
|
from sigal.image import Image
|
|
|
|
CURRENT_DIR = os.path.dirname(__file__)
|
|
TEST_IMAGE = 'exo20101028-b-full.jpg'
|
|
|
|
|
|
class TestImage(unittest.TestCase):
|
|
"Test the Image class."
|
|
|
|
def setUp(self):
|
|
self.temp_path = mkdtemp()
|
|
self.srcfile = os.path.join(CURRENT_DIR, 'sample', 'dir2', TEST_IMAGE)
|
|
self.dstfile = os.path.join(self.temp_path, TEST_IMAGE)
|
|
self.img = Image(self.srcfile)
|
|
|
|
def tearDown(self):
|
|
rmtree(self.temp_path)
|
|
|
|
def test_imgname(self):
|
|
self.assertEqual(self.img.imgname, TEST_IMAGE)
|
|
|
|
def test_save(self):
|
|
self.img.save(self.dstfile)
|
|
self.assertTrue(os.path.isfile(self.dstfile))
|