Skip to content

Commit

Permalink
Remove test that is not supported on python 3.6
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Nov 3, 2022
1 parent a76934c commit 1e26dc6
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tests/test_badfiles.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)

0 comments on commit 1e26dc6

Please sign in to comment.