def test__can_run_command(): try: command_handler = CommandHandler() command_handler.spawn_process() command_handler.run_command("test_command") assert command_handler is not None except Exception as ex: pytest.fail("error initialising CommandHandler: " + str(ex))
def test__can_run_command_and_set_session_log_buffer(): try: from tide.config.config import Config command_handler = CommandHandler() command_handler.spawn_process() result = command_handler.run_command("echo hi") buffer_result = Config().get_internal_buffer_caches() assert buffer_result.get("vg_session_log") is not None except Exception as ex: pytest.fail("error initialising CommandHandler: " + str(ex))
def test__can_run_command_and_return_lines(): try: command_handler = CommandHandler() command_handler.spawn_process() result = command_handler.run_command("echo hi") assert result == [ 'echo hi\r', 'hi\r', '/work/tide/tests/pytest_tests # \x1b[6n' ] except Exception as ex: pytest.fail("error initialising CommandHandler: " + str(ex))