tests/unit/test_process_utils/impl_aep_asyncio.py
raw| 1 | from osrf_pycommon.process_utils.async_execute_process import async_execute_process |
| 2 | from osrf_pycommon.process_utils import get_loop |
| 3 | |
| 4 | from .impl_aep_protocol import create_protocol |
| 5 | |
| 6 | loop = get_loop() |
| 7 | |
| 8 | |
| 9 | async def run(cmd, **kwargs): |
| 10 | transport, protocol = await async_execute_process( |
| 11 | create_protocol(), cmd, **kwargs) |
| 12 | retcode = await protocol.complete |
| 13 | transport.close() |
| 14 | return protocol.stdout_buffer, protocol.stderr_buffer, retcode |