mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Updated tests in light of #6060
This commit is contained in:
		
							parent
							
								
									7aa49741c6
								
							
						
					
					
						commit
						11948050ae
					
				| 
						 | 
					@ -27,22 +27,18 @@ def test_palette_rawmode():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for rawmode in ("RGB", None):
 | 
					    for rawmode in ("RGB", None):
 | 
				
			||||||
        rgb = im.getpalette(rawmode)
 | 
					        rgb = im.getpalette(rawmode)
 | 
				
			||||||
        assert len(rgb) == 256 * 3
 | 
					        assert rgb == [1, 2, 3]
 | 
				
			||||||
        assert rgb[:3] == [1, 2, 3]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert the RGB palette to RGBA
 | 
					    # Convert the RGB palette to RGBA
 | 
				
			||||||
    rgba = im.getpalette("RGBA")
 | 
					    rgba = im.getpalette("RGBA")
 | 
				
			||||||
    assert len(rgba) == 256 * 4
 | 
					    assert rgba == [1, 2, 3, 255]
 | 
				
			||||||
    assert rgba[:4] == [1, 2, 3, 255]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    im.putpalette((1, 2, 3, 4), "RGBA")
 | 
					    im.putpalette((1, 2, 3, 4), "RGBA")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert the RGBA palette to RGB
 | 
					    # Convert the RGBA palette to RGB
 | 
				
			||||||
    rgb = im.getpalette("RGB")
 | 
					    rgb = im.getpalette("RGB")
 | 
				
			||||||
    assert len(rgb) == 256 * 3
 | 
					    assert rgb == [1, 2, 3]
 | 
				
			||||||
    assert rgb[:3] == [1, 2, 3]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for rawmode in ("RGBA", None):
 | 
					    for rawmode in ("RGBA", None):
 | 
				
			||||||
        rgba = im.getpalette(rawmode)
 | 
					        rgba = im.getpalette(rawmode)
 | 
				
			||||||
        assert len(rgba) == 256 * 4
 | 
					        assert rgba == [1, 2, 3, 4]
 | 
				
			||||||
        assert rgba[:4] == [1, 2, 3, 4]
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user