REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.43 KB
Close
/proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/smmap/test/lib.py
Text
Base64
"""Provide base classes for the test system""" from unittest import TestCase import os import tempfile __all__ = ['TestBase', 'FileCreator'] #{ Utilities class FileCreator: """A instance which creates a temporary file with a prefix and a given size and provides this info to the user. Once it gets deleted, it will remove the temporary file as well.""" __slots__ = ("_size", "_path") def __init__(self, size, prefix=''): assert size, "Require size to be larger 0" self._path = tempfile.mktemp(prefix=prefix) self._size = size with open(self._path, "wb") as fp: fp.seek(size - 1) fp.write(b'1') assert os.path.getsize(self.path) == size def __del__(self): try: os.remove(self.path) except OSError: pass # END exception handling def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): self.__del__() @property def path(self): return self._path @property def size(self): return self._size #} END utilities class TestBase(TestCase): """Foundation used by all tests""" #{ Configuration k_window_test_size = 1000 * 1000 * 8 + 5195 #} END configuration #{ Overrides @classmethod def setUpAll(cls): # nothing for now pass # END overrides #{ Interface #} END interface
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-02-06 08:01:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lib.py
1.43 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_buf.py
5.31 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_mman.py
10.56 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_tutorial.py
3.10 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_util.py
3.39 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).