mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-04-29 10:14:37 +08:00
Implement Preset Argument in tarfile.open Function and Add Test Coverage (#11251)
This commit is contained in:
@@ -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