From 7d983dc4fd1281d1e2ebde737cb4daa40d089db0 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 3 Nov 2022 11:38:25 +0900 Subject: [PATCH] Remove test that is not supported on python 3.6 Signed-off-by: Hiroshi Miura --- tests/test_badfiles.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/tests/test_badfiles.py b/tests/test_badfiles.py index 32e1e1ed..9a1ecd0d 100644 --- a/tests/test_badfiles.py +++ b/tests/test_badfiles.py @@ -1,10 +1,7 @@ # Security protection test cases import ctypes import os -import pathlib import sys -from dataclasses import dataclass -from tempfile import TemporaryDirectory import pytest @@ -79,28 +76,3 @@ def test_extract_symlink_attack(tmp_path): with pytest.raises(Bad7zFile): with SevenZipFile(target, "r") as archive: archive.extractall(path=target_dir) - - -def test_write_compressed_archive(tmp_path): - @dataclass - class Contents: - filename: str - text: str - - contents = (Contents(filename="bin/qmake", text="qqqqq"), Contents(filename="lib/libhoge.so", text="hoge")) - with TemporaryDirectory() as temp_path, SevenZipFile( - tmp_path / "tools_qtcreator-linux-qt.tools.qtcreator.7z", "w" - ) as archive: - dest = pathlib.Path(temp_path) - for folder in ("bin", "lib", "mkspecs"): - (dest / folder).mkdir(parents=True, exist_ok=True) - for f in contents: - full_path = dest / f.filename - if not full_path.parent.exists(): - full_path.parent.mkdir(parents=True) - full_path.write_text(f.text, "utf_8") - archive.writeall(path=temp_path, arcname="target") - with TemporaryDirectory() as target_path, SevenZipFile( - tmp_path / "tools_qtcreator-linux-qt.tools.qtcreator.7z", "r" - ) as archive: - archive.extractall(path=target_path)