How to use the shellingham.posix._core.Process function in shellingham

To help you get started, we’ve selected a few shellingham examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sarugaku / shellingham / tests / test_ps.py View on Github external
F S UID      PID     PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
240001 A 203 14549132  8192226   1  60 20 96aaf7590 2620 2552          pts/0  0:00 -bash
200001 A 203  6384118 14549132   3  61 20 8aaeeb590 1440 1468          pts/0  0:00 ps wwl
    """,    # noqa
    """\
     F S      UID    PID   PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
240000 A      105 932687 932686   0  20 20    0 7516    0          pts/0  0:00 -bash
200000 A      105 932807 932687   0  20 20    0 16504    0          pts/0  0:00 python3
200000 A      105 932808 932807   0  20 20    0 6792    0          pts/0  0:00 ps wwl
    """,    # noqa
]

PS_EXPECTED = [
    {
        '90585': Process(pid='90585', ppid='90584', args=('-bash',)),
        '96095': Process(pid='96095', ppid='90585', args=('pbcopy',)),
        '82490': Process(pid='82490', ppid='82489', args=('-bash',)),
        '82557': Process(pid='82557', ppid='82556', args=('-bash',)),
    },
    {
        '14549132': Process(pid='14549132', ppid='8192226', args=('-bash',)),
        '6384118': Process(pid='6384118', ppid='14549132', args=('ps', 'wwl')),
    },
    {
        '932687': Process(pid='932687', ppid='932686', args=('-bash',)),
        '932807': Process(pid='932807', ppid='932687', args=('python3')),
        '932808': Process(pid='932808', ppid='932807', args=('ps', 'wwl')),
    },
]


@pytest.mark.parametrize(

shellingham

Tool to Detect Surrounding Shell

ISC
Latest version published 1 year ago

Package Health Score

77 / 100
Full package analysis