mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-15 16:27:08 +08:00
Implement Preset Argument in tarfile.open Function and Add Test Coverage (#11251)
This commit is contained in:
13
test_cases/stdlib/check_tarfile.py
Normal file
13
test_cases/stdlib/check_tarfile.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import tarfile
|
||||
|
||||
with tarfile.open("test.tar.xz", "w:xz") as tar:
|
||||
pass
|
||||
|
||||
# Test with valid preset values
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=0)
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=5)
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=9)
|
||||
|
||||
# Test with invalid preset values
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=-1) # type: ignore
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=10) # type: ignore
|
||||
Reference in New Issue
Block a user