mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Pass file handle to ContainerIO
This commit is contained in:
		
							parent
							
								
									f9767fb00f
								
							
						
					
					
						commit
						aef3aa2ab3
					
				| 
						 | 
					@ -4,8 +4,6 @@ import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from PIL import ContainerIO, Image
 | 
					from PIL import ContainerIO, Image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .helper import hopper
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST_FILE = "Tests/images/dummy.container"
 | 
					TEST_FILE = "Tests/images/dummy.container"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,15 +13,15 @@ def test_sanity() -> None:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_isatty() -> None:
 | 
					def test_isatty() -> None:
 | 
				
			||||||
    with hopper() as im:
 | 
					    with open(TEST_FILE, "rb") as fh:
 | 
				
			||||||
        container = ContainerIO.ContainerIO(im, 0, 0)
 | 
					        container = ContainerIO.ContainerIO(fh, 0, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert container.isatty() is False
 | 
					    assert container.isatty() is False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_seekable() -> None:
 | 
					def test_seekable() -> None:
 | 
				
			||||||
    with hopper() as im:
 | 
					    with open(TEST_FILE, "rb") as fh:
 | 
				
			||||||
        container = ContainerIO.ContainerIO(im, 0, 0)
 | 
					        container = ContainerIO.ContainerIO(fh, 0, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert container.seekable() is True
 | 
					    assert container.seekable() is True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user