mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-30 23:47:27 +03:00 
			
		
		
		
	Merge pull request #929 from hugovk/MspImagePlugin
More tests for MspImagePlugin
This commit is contained in:
		
						commit
						e6cbe05211
					
				
							
								
								
									
										
											BIN
										
									
								
								Tests/images/hopper.msp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tests/images/hopper.msp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -2,11 +2,12 @@ from helper import unittest, PillowTestCase, hopper | |||
| 
 | ||||
| from PIL import Image | ||||
| 
 | ||||
| TEST_FILE = "Tests/images/hopper.msp" | ||||
| 
 | ||||
| 
 | ||||
| class TestFileMsp(PillowTestCase): | ||||
| 
 | ||||
|     def test_sanity(self): | ||||
| 
 | ||||
|         file = self.tempfile("temp.msp") | ||||
| 
 | ||||
|         hopper("1").save(file) | ||||
|  | @ -17,6 +18,23 @@ class TestFileMsp(PillowTestCase): | |||
|         self.assertEqual(im.size, (128, 128)) | ||||
|         self.assertEqual(im.format, "MSP") | ||||
| 
 | ||||
|     def test_open(self): | ||||
|         # Arrange | ||||
|         # Act | ||||
|         im = Image.open(TEST_FILE) | ||||
| 
 | ||||
|         # Assert | ||||
|         self.assertEqual(im.size, (128, 128)) | ||||
|         self.assert_image_similar(im, hopper("1"), 4) | ||||
| 
 | ||||
|     def test_cannot_save_save_wrong_mode(self): | ||||
|         # Arrange | ||||
|         im = hopper() | ||||
|         file = self.tempfile("temp.msp") | ||||
| 
 | ||||
|         # Act/Assert | ||||
|         self.assertRaises(IOError, lambda: im.save(file)) | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     unittest.main() | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user