File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -178,15 +178,14 @@ def tearDown(self) -> None:
178
178
f"[info]: The temporary directory at '{ self .temporary_dir_path } ' is not deleted since the DEBUG is set to True."
179
179
)
180
180
181
- def assertArchiveFileIsGzip (self , path : Path ) -> None :
182
- cmd_result = run_executable (["gunzip" , "-t" , str (path )])
183
- self .assertTrue (
184
- "not in gzip format" not in cmd_result .output ,
185
- msg = "Hint: Did you forget to use '-z' flag when creating the archive?" ,
186
- )
187
- self .assertCommandSuccessful (
188
- cmd_result ,
189
- )
181
+ def assertArchiveFileIsGzip (self , path : str | Path ) -> None :
182
+ if isinstance (path , str ):
183
+ path = Path (path )
184
+ with open (path , "rb" ) as f :
185
+ self .assertTrue (
186
+ f .read (2 ) == b"\x1f \x8b " ,
187
+ msg = "Hint: Did you forget to use '-z' flag when creating the archive?" ,
188
+ )
190
189
191
190
def assertFileExists (
192
191
self , path : Path , msg_template : str = FILE_NOT_EXIST_TEXT_TEMPLATE
You can’t perform that action at this time.
0 commit comments