Esempio n. 1
0
def test_sub_group():
    resolver = Resolver()

    @resolver.group()
    def foo():
        pass

    @resolver.group(foo)
    def sub_foo():
        pass

    result = ClickRunner(foo).invoke("sub-foo")
    result.assert_successful()
Esempio n. 2
0
def test_command():
    resolver = Resolver()

    @resolver.group()
    def foo():
        pass

    @resolver.command(foo)
    def command():
        pass

    result = ClickRunner(foo).invoke("command")
    result.assert_successful()
Esempio n. 3
0
def test_double_submission_command():
    resolver = Resolver()
    resolver.register_values(a=4)

    @resolver.group()
    def group():
        pass

    @resolver.command(group)
    @click.option("--a")
    def foo(a):
        pass

    result = ClickRunner(group).invoke("foo", "--a", "woah")

    result.assert_successful()