| 40 | |
| 41 | |
| 42 | def test_executor_execute(): |
| 43 | # type: () -> None |
| 44 | assert Executor.execute("/bin/echo -n stdout >&1", shell=True) == ("stdout", "") |
| 45 | assert Executor.execute("/bin/echo -n stderr >&2", shell=True) == ("", "stderr") |
| 46 | assert Executor.execute("/bin/echo -n TEST | tee /dev/stderr", shell=True) == ("TEST", "TEST") |
| 47 | assert Executor.execute(["/bin/echo", "hello"]) == ("hello\n", "") |
| 48 | assert Executor.execute(["/bin/echo", "-n", "hello"]) == ("hello", "") |
| 49 | assert Executor.execute("/bin/echo -n $HELLO", env={"HELLO": "hey"}, shell=True) == ("hey", "") |
| 50 | |
| 51 | |
| 52 | def test_executor_execute_zero(): |