MCPcopy Create free account
hub / github.com/bloomberg/pystack / test_format_psinfo

Function test_format_psinfo

tests/unit/test_main.py:1198–1232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1196
1197
1198def test_format_psinfo():
1199 # GIVEN
1200 info = {
1201 "state": 0,
1202 "sname": 82,
1203 "zomb": 0,
1204 "nice": 0,
1205 "flag": 4212480,
1206 "uid": 0,
1207 "gid": 0,
1208 "pid": 75639,
1209 "ppid": 1,
1210 "pgrp": 75639,
1211 "sid": 1,
1212 "fname": "a.out",
1213 "psargs": "./a.out ",
1214 }
1215
1216 # WHEN
1217 with patch("os.environ", {"NO_COLOR": 1}):
1218 result = format_psinfo_information(info)
1219
1220 # THEN
1221
1222 expected = dedent(
1223 """\
1224 Core file information:
1225 state: R zombie: True niceness: 0
1226 pid: 75639 ppid: 1 sid: 1
1227 uid: 0 gid: 0 pgrp: 75639
1228 executable: a.out arguments: ./a.out
1229 """
1230 )
1231
1232 assert expected.strip() == result.strip()
1233
1234
1235@pytest.mark.parametrize("method", ["extract_ps_info", "extract_failure_info"])

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected