OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
importlib_resources
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
__init__.py
0 bytes
05/09/2024 06:58:26 AM
rw-r--r--
📁
__pycache__
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
_compat.py
435 bytes
05/09/2024 06:58:26 AM
rw-r--r--
📁
data01
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
data02
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
namespacedata01
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
test_compatibilty_files.py
3.18 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_contents.py
968 bytes
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_files.py
1.16 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_open.py
2.5 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_path.py
2.05 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_read.py
2.35 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_reader.py
4.19 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
test_resource.py
7.95 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
update-zips.py
1.38 KB
05/09/2024 06:58:26 AM
rw-r--r--
📄
util.py
5.18 KB
05/09/2024 06:58:26 AM
rw-r--r--
📁
zipdata01
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
zipdata02
-
05/09/2024 06:58:27 AM
rwxr-xr-x
Editing: update-zips.py
Close
""" Generate the zip test data files. Run to build the tests/zipdataNN/ziptestdata.zip files from files in tests/dataNN. Replaces the file with the working copy, but does commit anything to the source repo. """ import contextlib import os import pathlib import zipfile def main(): """ >>> from unittest import mock >>> monkeypatch = getfixture('monkeypatch') >>> monkeypatch.setattr(zipfile, 'ZipFile', mock.MagicMock()) >>> print(); main() # print workaround for bpo-32509 <BLANKLINE> ...data01... -> ziptestdata/... ... ...data02... -> ziptestdata/... ... """ suffixes = '01', '02' tuple(map(generate, suffixes)) def generate(suffix): root = pathlib.Path(__file__).parent.relative_to(os.getcwd()) zfpath = root / f'zipdata{suffix}/ziptestdata.zip' with zipfile.ZipFile(zfpath, 'w') as zf: for src, rel in walk(root / f'data{suffix}'): dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix()) print(src, '->', dst) zf.write(src, dst) def walk(datapath): for dirpath, dirnames, filenames in os.walk(datapath): with contextlib.suppress(KeyError): dirnames.remove('__pycache__') for filename in filenames: res = pathlib.Path(dirpath) / filename rel = res.relative_to(datapath) yield res, rel __name__ == '__main__' and main()