test_bashcomplete.py
This file
Path
tests/test_bashcomplete.py
20 lines · 547 bytes · Python
Last changed by
bashcomplete: Adapt to changes for chain commandsMarkus Unterwaditzerbefore adoption37011e7
History of this fileTake it
bashcomplete: Adapt to changes for chain commandsMarkus Unterwaditzerbefore adoption37011e7
lines 1–20why, one step back1# -*- coding: utf-8 -*-23import click4from click._bashcomplete import get_choices56def test_basic():7 @click.group()8 @click.option('--global-opt')9 def cli(global_opt):10 pass1112 @cli.command()13 @click.option('--local-opt')14 def sub(local_opt):15 pass1617 assert list(get_choices(cli, 'lol', [], '')) == ['sub']18 assert list(get_choices(cli, 'lol', [], '-')) == ['--global-opt']19 assert list(get_choices(cli, 'lol', ['sub'], '')) == []20 assert list(get_choices(cli, 'lol', ['sub'], '-')) == ['--local-opt']