(self)
| 326 | assert call("list", cwd=subdir) == 0 |
| 327 | |
| 328 | def test_command_not_found(self) -> None: |
| 329 | na_msg = """ |
| 330 | The list command is not available from this location. |
| 331 | These commands are only available from within a project: check, crawl, edit, list, parse. |
| 332 | """ |
| 333 | not_found_msg = """ |
| 334 | Unknown command: abc |
| 335 | """ |
| 336 | params = [ |
| 337 | ("list", False, na_msg), |
| 338 | ("abc", False, not_found_msg), |
| 339 | ("abc", True, not_found_msg), |
| 340 | ] |
| 341 | for cmdname, inproject, message in params: |
| 342 | with mock.patch("sys.stdout", new=StringIO()) as out: |
| 343 | _print_unknown_command_msg(Settings(), cmdname, inproject) |
| 344 | assert out.getvalue().strip() == message.strip() |
| 345 | |
| 346 | |
| 347 | class TestBenchCommand: |
nothing calls this directly
no test coverage detected