def test_popen_with_sudo_python(self): spec = XSpec("popen//python=sudo python3") assert popen_args(spec) == [ 'sudo', 'python3', '-u', '-c', 'import sys;exec(eval(sys.stdin.readline()))' ]
def test_popen_args(spec, expected_args): expected_args = expected_args + [ '-u', '-c', gateway_io.popen_bootstrapline] args = gateway_io.popen_args(execnet.XSpec(spec)) assert args == expected_args