Test a single command and report results.
(
self, command: str, description: str, expect_in_output: List[str] = None
)
| 84 | print() |
| 85 | |
| 86 | def test_command( |
| 87 | self, command: str, description: str, expect_in_output: List[str] = None |
| 88 | ): |
| 89 | """Test a single command and report results.""" |
| 90 | output.print(f"[dim]Testing:[/dim] {description}") |
| 91 | output.print(f"[yellow]Command:[/yellow] {command}") |
| 92 | |
| 93 | success = self.run_command(command, expect_in_output) |
| 94 | |
| 95 | if success: |
| 96 | output.success("✓ Passed") |
| 97 | else: |
| 98 | output.error("✗ Failed") |
| 99 | if expect_in_output: |
| 100 | output.warning(f"Expected to find: {', '.join(expect_in_output)}") |
| 101 | |
| 102 | self.test_results.append( |
| 103 | {"command": command, "description": description, "success": success} |
| 104 | ) |
| 105 | print() |
| 106 | return success |
| 107 | |
| 108 | def run_demo(self): |
| 109 | """Run the complete e2e demo.""" |
no test coverage detected