Skip to content

Commit

Permalink
Merge pull request #2 from hugovk/radarhere-features
Browse files Browse the repository at this point in the history
Test unsupported features
  • Loading branch information
radarhere committed May 15, 2015
2 parents aed878e + 05987c8 commit ebdfb87
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,28 @@ class TestFeatures(PillowTestCase):

def test_check_features(self):
for feature in features.modules:
self.assertTrue(features.check_module(feature) in [True, False, None])
self.assertTrue(
features.check_module(feature) in [True, False, None])
for feature in features.codecs:
self.assertTrue(features.check_codec(feature) in [True, False])

def test_supported_features(self):
self.assertTrue(type(features.get_supported_modules()) is list)
self.assertTrue(type(features.get_supported_codecs()) is list)

def test_unsupported_codec(self):
# Arrange
codec = "unsupported_codec"
# Act / Assert
self.assertRaises(ValueError, lambda: features.check_codec(codec))

def test_unsupported_module(self):
# Arrange
module = "unsupported_module"
# Act / Assert
self.assertRaises(ValueError, lambda: features.check_module(module))


if __name__ == '__main__':
unittest.main()

Expand Down

0 comments on commit ebdfb87

Please sign in to comment.