Normalize a block of text to perform comparison. Strip newlines from the very beginning and very end Then split into separate lines and strip trailing whitespace from each line.
(block: str)
| 49 | |
| 50 | |
| 51 | def normalize(block: str) -> list[str]: |
| 52 | """Normalize a block of text to perform comparison. |
| 53 | |
| 54 | Strip newlines from the very beginning and very end Then split into separate lines and strip trailing whitespace |
| 55 | from each line. |
| 56 | """ |
| 57 | assert isinstance(block, str) |
| 58 | block = block.strip("\n") |
| 59 | return [line.rstrip() for line in block.splitlines()] |
| 60 | |
| 61 | |
| 62 | def run_cmd(app: cmd2.Cmd, cmd: str) -> tuple[list[str], list[str]]: |
no outgoing calls
no test coverage detected
searching dependent graphs…