mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-25 05:01:26 +03:00 
			
		
		
		
	To better follow conventional pytest style, this removes the outer wrapper class in favor of a function for some tests. These tests were picked as they are relatively simple and presented no barriers to a quick port. The assert* methods are replaced with assert statements. When necessary, a fixture is used to create a temporary directory. This commit does not convert the entire test suite to this style as some test classes use methods or other advanced features that are difficult to automatically convert. The goal is to address these issues in followup commits. Refs #4193
		
			
				
	
	
		
			14 lines
		
	
	
		
			600 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			600 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from PIL import Image
 | |
| 
 | |
| 
 | |
| def test_getbands():
 | |
|     assert Image.new("1", (1, 1)).getbands() == ("1",)
 | |
|     assert Image.new("L", (1, 1)).getbands() == ("L",)
 | |
|     assert Image.new("I", (1, 1)).getbands() == ("I",)
 | |
|     assert Image.new("F", (1, 1)).getbands() == ("F",)
 | |
|     assert Image.new("P", (1, 1)).getbands() == ("P",)
 | |
|     assert Image.new("RGB", (1, 1)).getbands() == ("R", "G", "B")
 | |
|     assert Image.new("RGBA", (1, 1)).getbands() == ("R", "G", "B", "A")
 | |
|     assert Image.new("CMYK", (1, 1)).getbands() == ("C", "M", "Y", "K")
 | |
|     assert Image.new("YCbCr", (1, 1)).getbands() == ("Y", "Cb", "Cr")
 |