From 7bca6edadfff2585058b25a031f58b3d54269010 Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Wed, 11 May 2011 11:33:43 +0530 Subject: [PATCH] PIL requirement added --- TODO.rst | 1 - dev-req.txt | 1 + hyde/ext/plugins/images.py | 2 ++ hyde/tests/ext/test_images.py | 9 ++++++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/TODO.rst b/TODO.rst index bf06360..23f2bc5 100644 --- a/TODO.rst +++ b/TODO.rst @@ -1,3 +1,2 @@ * Unit test for Language plugin -* Unit test for Image size plugin * Unit test for git dates plugin diff --git a/dev-req.txt b/dev-req.txt index 4356410..5333f7f 100644 --- a/dev-req.txt +++ b/dev-req.txt @@ -13,3 +13,4 @@ nose==1.0.0 pep8==0.6.1 pylint==0.22.0 pysmell==0.7.3 +PIL diff --git a/hyde/ext/plugins/images.py b/hyde/ext/plugins/images.py index e47d5e7..fd7fe4d 100644 --- a/hyde/ext/plugins/images.py +++ b/hyde/ext/plugins/images.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- """ Contains classes to handle images related things + +# Requires PIL """ from hyde.plugin import Plugin diff --git a/hyde/tests/ext/test_images.py b/hyde/tests/ext/test_images.py index 7586f6c..ee3b191 100644 --- a/hyde/tests/ext/test_images.py +++ b/hyde/tests/ext/test_images.py @@ -3,6 +3,8 @@ Use nose `$ pip install nose` `$ nosetests` + +Requires PIL """ from hyde.fs import File, Folder from hyde.generator import Generator @@ -15,6 +17,9 @@ IMAGE_SOURCE = File(__file__).parent.child_folder('optipng') IMAGE_NAME = "hyde-lt-b.png" IMAGE_SIZE = (538, 132) +# PIL requirement +import Image + class TestImageSizer(object): def setUp(self): @@ -83,9 +88,7 @@ class TestImageSizer(object): def test_size_image_multiline(self): text = u""" - + """ % IMAGE_NAME html = self._generic_test_image(text) assert ' width="%d"' % IMAGE_SIZE[0] in html