-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import unittest2 | ||
|
||
from willow.backends import pillow as pillow_backend | ||
|
||
|
||
class TestPillowOperations(unittest2.TestCase): | ||
def setUp(self): | ||
with open('tests/images/transparent.png', 'rb') as f: | ||
self.backend = pillow_backend.PillowBackend.from_file(f) | ||
|
||
def test_get_size(self): | ||
width, height = pillow_backend.get_size(self.backend) | ||
self.assertEqual(width, 200) | ||
self.assertEqual(height, 150) | ||
|
||
def test_resize(self): | ||
pillow_backend.resize(self.backend, 100, 75) | ||
self.assertEqual(self.backend.image.size, (100, 75)) | ||
|
||
def test_resize(self): | ||
pillow_backend.resize(self.backend, 100, 75) | ||
self.assertEqual(self.backend.image.size, (100, 75)) | ||
|
||
def test_has_alpha(self): | ||
has_alpha = pillow_backend.has_alpha(self.backend) | ||
self.assertTrue(has_alpha) | ||
|
||
def test_has_animation(self): | ||
has_animation = pillow_backend.has_animation(self.backend) | ||
self.assertFalse(has_animation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import unittest2 | ||
|
||
from willow.backends import wand as wand_backend | ||
|
||
|
||
class TestWandOperations(unittest2.TestCase): | ||
def setUp(self): | ||
with open('tests/images/transparent.png', 'rb') as f: | ||
self.backend = wand_backend.WandBackend.from_file(f) | ||
|
||
def test_get_size(self): | ||
width, height = wand_backend.get_size(self.backend) | ||
self.assertEqual(width, 200) | ||
self.assertEqual(height, 150) | ||
|
||
def test_resize(self): | ||
wand_backend.resize(self.backend, 100, 75) | ||
self.assertEqual(self.backend.image.size, (100, 75)) | ||
|
||
def test_resize(self): | ||
wand_backend.resize(self.backend, 100, 75) | ||
self.assertEqual(self.backend.image.size, (100, 75)) | ||
|
||
def test_has_alpha(self): | ||
has_alpha = wand_backend.has_alpha(self.backend) | ||
self.assertTrue(has_alpha) | ||
|
||
def test_has_animation(self): | ||
has_animation = wand_backend.has_animation(self.backend) | ||
self.assertFalse(has_animation) |