(self, cmd: str, read_timeout: float)
| 1481 | return output |
| 1482 | |
| 1483 | def command_echo_read(self, cmd: str, read_timeout: float) -> str: |
| 1484 | # Make sure you read until you detect the command echo (avoid getting out of sync) |
| 1485 | new_data = self.read_until_pattern(pattern=re.escape(cmd), read_timeout=read_timeout) |
| 1486 | |
| 1487 | # There can be echoed prompts that haven't been cleared before the cmd echo |
| 1488 | # this can later mess up the trailing prompt pattern detection. Clear this out. |
| 1489 | lines = new_data.split(cmd) |
| 1490 | if len(lines) == 2: |
| 1491 | # lines[-1] should realistically just be the null string |
| 1492 | new_data = f"{cmd}{lines[-1]}" |
| 1493 | else: |
| 1494 | # cmd exists in the output multiple times? Just retain the original output |
| 1495 | pass |
| 1496 | return new_data |
| 1497 | |
| 1498 | @select_cmd_verify |
| 1499 | def send_command_timing( |
no test coverage detected