Skip to content

Commit

Permalink
Fixed test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 7, 2017
1 parent 2a93cdb commit 8974222
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,33 @@ def test_alpha_composite(self):
self.assertEqual(img_colors, expected_colors)

def test_registered_extensions_uninitialized(self):
# Arrange
Image._initialized = 0
extension = Image.EXTENSION
Image.EXTENSION = {}

# Act
ext = Image.registered_extensions()
Image.registered_extensions()

# Assert
self.assertTrue(bool(ext))
self.assertEqual(Image._initialized, 2)

# Restore the original state and assert
Image.EXTENSION = extension
self.assertTrue(Image.EXTENSION)

def test_registered_extensions(self):
# Arrange
# Open an image to trigger plugin registration
Image.open('Tests/images/rgb.jpg')

# Act
ext = Image.registered_extensions()
extensions = Image.registered_extensions()

# Assert
self.assertTrue(bool(ext))
self.assertTrue(bool(extensions))
for ext in ['.cur', '.icns', '.tif', '.tiff']:
self.assertIn(ext, extensions)

def test_effect_mandelbrot(self):
# Arrange
Expand Down

0 comments on commit 8974222

Please sign in to comment.