Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /usr/local/lib/python3.8/dist-packages/traitlets/tests/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //usr/local/lib/python3.8/dist-packages/traitlets/tests/utils.py

from subprocess import Popen, PIPE
import sys


def get_output_error_code(cmd):
    """Get stdout, stderr, and exit code from running a command"""
    p = Popen(cmd, stdout=PIPE, stderr=PIPE)
    out, err = p.communicate()
    out = out.decode('utf8', 'replace')
    err = err.decode('utf8', 'replace')
    return out, err, p.returncode


def check_help_output(pkg, subcommand=None):
    """test that `python -m PKG [subcommand] -h` works"""
    cmd = [sys.executable, '-m', pkg]
    if subcommand:
        cmd.extend(subcommand)
    cmd.append('-h')
    out, err, rc = get_output_error_code(cmd)
    assert rc == 0, err
    assert "Traceback" not in err
    assert "Options" in out
    assert "--help-all" in out
    return out, err


def check_help_all_output(pkg, subcommand=None):
    """test that `python -m PKG --help-all` works"""
    cmd = [sys.executable, '-m', pkg]
    if subcommand:
        cmd.extend(subcommand)
    cmd.append('--help-all')
    out, err, rc = get_output_error_code(cmd)
    assert rc == 0, err
    assert "Traceback" not in err
    assert "Options" in out
    assert "Class options" in out
    return out, err

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net