mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	More spider tests
This commit is contained in:
		
							parent
							
								
									5f9cad1a8e
								
							
						
					
					
						commit
						14c8d8afe4
					
				| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
from tester import *
 | 
					from tester import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from PIL import Image
 | 
					from PIL import Image
 | 
				
			||||||
 | 
					from PIL import SpiderImagePlugin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_file = "Tests/images/lena.spider"
 | 
					test_file = "Tests/images/lena.spider"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,4 +13,24 @@ def test_sanity():
 | 
				
			||||||
    assert_equal(im.size, (128, 128))
 | 
					    assert_equal(im.size, (128, 128))
 | 
				
			||||||
    assert_equal(im.format, "SPIDER")
 | 
					    assert_equal(im.format, "SPIDER")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_save():
 | 
				
			||||||
 | 
					    # Arrange
 | 
				
			||||||
 | 
					    temp = tempfile('temp.spider')
 | 
				
			||||||
 | 
					    im = lena()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Act
 | 
				
			||||||
 | 
					    im.save(temp, "SPIDER")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Assert
 | 
				
			||||||
 | 
					    im2 = Image.open(temp)
 | 
				
			||||||
 | 
					    assert_equal(im2.mode, "F")
 | 
				
			||||||
 | 
					    assert_equal(im2.size, (128, 128))
 | 
				
			||||||
 | 
					    assert_equal(im2.format, "SPIDER")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_isSpiderImage():
 | 
				
			||||||
 | 
					    assert_true(SpiderImagePlugin.isSpiderImage(test_file))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# End of file
 | 
					# End of file
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user