def test_invoke_no_args(self): shell = Shell() ctx = shell.make_context('click-shell-test', args=[]) with pytest.raises(IOError): shell.invoke(ctx)
def test_invoke_with_args(self): shell = Shell() # Create a 'foo' command @shell.command() def foo(): click.echo('bar') return 0 ctx = shell.make_context('click-shell-test', args=['foo']) retcode = shell.invoke(ctx) assert retcode == 0