(self, cmd_block, sandboxed_install_run)
| 174 | return load_command_blocks_from_readme(readme) |
| 175 | |
| 176 | def run(self, cmd_block, sandboxed_install_run): |
| 177 | # Remove whitespace args and escaped newlines |
| 178 | command = [arg for arg in str(cmd_block).strip().split(" ") if arg.strip() and arg != "\\\n"] |
| 179 | status = sandboxed_install_run(command, cwd=self.path) |
| 180 | |
| 181 | cmd_print = f"Note: Command was: {' '.join(command)}" |
| 182 | if cmd_block.xfail: |
| 183 | assert not status.success, f"Command that was expected to fail did not fail. {cmd_print}" |
| 184 | else: |
| 185 | assert status.success, f"Command that was expected to succeed did not succeed. {cmd_print}" |
| 186 | return status |
| 187 | |
| 188 | def __exit__(self, exc_type, exc_value, traceback): |
| 189 | """ |
no test coverage detected