(app)
| 348 | |
| 349 | |
| 350 | def test_cli_invoke(app): |
| 351 | @app.cli.command("hello") |
| 352 | def hello_command(): |
| 353 | click.echo("Hello, World!") |
| 354 | |
| 355 | runner = app.test_cli_runner() |
| 356 | # invoke with command name |
| 357 | result = runner.invoke(args=["hello"]) |
| 358 | assert "Hello" in result.output |
| 359 | # invoke with command object |
| 360 | result = runner.invoke(hello_command) |
| 361 | assert "Hello" in result.output |
| 362 | |
| 363 | |
| 364 | def test_cli_custom_obj(app): |
nothing calls this directly
no test coverage detected